[klibc] [git pull v2] x86_32, sh4, getrusage()

maximilian attems max at stro.at
Wed Jul 7 05:14:09 PDT 2010


hello hpa,

here my birthday submission :)
please pull:
git pull git://git.debian.org/users/maks/klibc.git maks

Sam fixed a longstanding x86_32 build bug, thus it seems a good time
to flush the queue of the piled up patches, the shortlog tells it:

Aurelien Jarno (1):
      [klibc] sh4: syscalls fixes

Benjamin Cama (1):
      [klibc] fstype: btrfs size endianness fix

Mike Waychison (2):
      [klibc] CFLAGS: enable -fwrapv
      [klibc] Add ancillary data structures and macros to sys/socket.h

Sam Ravnborg (1):
      [klibc] fix build on native i386

Thorsten Glaser (1):
      [klibc] add getrusage()

maximilian attems (6):
      [klibc] resume: silence warning on resume try
      [klibc] bootp_packet.h minor stylistic fix
      [klibc] fstype: list the includes in alphabetic order
      [klibc] ipconfig: packet_send() fix uninitialized valgrind errors
      [klibc] valgrind: netdev_sif_addr fix unitialized valgrind error
      [klibc] x86_64: MMCONFIG cleanup vestige from pre x86 merge

 git diff -M --stat  --summary master...maks
 scripts/Kbuild.klibc              |    3 +-
 usr/include/sys/resource.h        |    2 +
 usr/include/sys/socket.h          |   80 +++++++++++++++++++++++++++++++++++++
 usr/kinit/fstype/fstype.c         |   18 ++++----
 usr/kinit/ipconfig/bootp_packet.h |    2 +-
 usr/kinit/ipconfig/netdev.c       |    1 +
 usr/kinit/ipconfig/packet.c       |   19 +++++----
 usr/kinit/resume/resumelib.c      |    2 +-
 usr/klibc/SYSCALLS.def            |    3 +-
 usr/klibc/arch/i386/MCONFIG       |    3 +
 usr/klibc/arch/sh/Kbuild          |    2 +-
 usr/klibc/arch/sh/pipe.S          |   35 ++++++++++++++++
 usr/klibc/arch/sh/syscall.S       |   14 +++---
 usr/klibc/arch/x86_64/MCONFIG     |    3 -
 14 files changed, 154 insertions(+), 33 deletions(-)
 create mode 100644 usr/klibc/arch/sh/pipe.S

patch queue follows here, thanks
maks


commit d2ec94f3d4387ca5c45c7e88b70f0e4bcd90f169
Author: maximilian attems <max at stro.at>
Date:   Wed Jul 7 13:49:05 2010 +0200

    [klibc] x86_64: MMCONFIG cleanup vestige from pre x86 merge
    
    this assignment is useless these days, so just get rid of it.
    
    Reported-by: Sam Ravnborg <sam at ravnborg.org>
    Signed-off-by: maximilian attems <max at stro.at>

diff --git a/usr/klibc/arch/x86_64/MCONFIG b/usr/klibc/arch/x86_64/MCONFIG
index 7d5eea7..d4ff5ea 100644
--- a/usr/klibc/arch/x86_64/MCONFIG
+++ b/usr/klibc/arch/x86_64/MCONFIG
@@ -37,6 +37,3 @@ KLIBCSHAREDFLAGS     = -Ttext 0x00200200 -z max-page-size=0x100000
 
 # Asm includes for x86_64 are in the merged x86 tree
 KLIBCARCHINCFLAGS = -I$(KLIBCKERNELOBJ)/arch/x86/include
-
-# Additional asm- directories needed during installation
-ASMARCH = asm-i386

commit 28da73a8add68f4abf68c417ac9559acc5d06861
Author: Sam Ravnborg <sam at ravnborg.org>
Date:   Wed Jul 7 00:01:46 2010 +0200

    [klibc] fix build on native i386
    
    When trying to build klibc on a native i386 box it
    failed to include asm/posix_types.h
    
    This was tracked down to a wrong include path.
    For x86_64 it was correct.
    Fix it for i386.
    
    This should fix the build problem reported Phil Howard.
    
    "FYI basically same patch was done and tested in OpenEmbedded on 2010-07-01"
    - Andrea Adami <andrea.adami at gmail.com>
    
    6f08923d3024f108b6262258c913573fb6ea78e6 fixed allmost all other unified
    archs.
    
    Signed-off-by: Sam Ravnborg <sam at ravnborg.org>
    Cc: Phil Howard <kunnskaperen at gmail.com>
    Signed-off-by: maximilian attems <max at stro.at>

diff --git a/usr/klibc/arch/i386/MCONFIG b/usr/klibc/arch/i386/MCONFIG
index ef112a4..1150ece 100644
--- a/usr/klibc/arch/i386/MCONFIG
+++ b/usr/klibc/arch/i386/MCONFIG
@@ -31,3 +31,6 @@ KLIBCBITSIZE  = 32
 # calls, and work on the memory models for this architecture
 # 96 MB - normal binaries start at 128 MB
 KLIBCSHAREDFLAGS	= -Ttext 0x06000200
+
+# Asm includes for i386 are in the merged x86 tree
+KLIBCARCHINCFLAGS = -I$(KLIBCKERNELOBJ)/arch/x86/include

commit 1e2af5b16918993b0c61b3069f1436ffdfcf2983
Author: maximilian attems <max at stro.at>
Date:   Wed Jul 7 13:42:59 2010 +0200

    [klibc] valgrind: netdev_sif_addr fix unitialized valgrind error
    
    memset struct sockaddr_in sin and thus get a clean valgrind ipconfig run.
    
    Fixes:
    ==15636== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)
    ==15636==
    ==15636== 1 errors in context 1 of 3:
    ==15636== Syscall param ioctl(SIOCSIF*ADDR) points to uninitialised byte(s)
    ==15636==    at 0x403EB1: __syscall_common (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
    ==15636==    by 0x401859: netdev_setaddress (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
    ==15636==    by 0x30687464: ???
    ==15636==  Address 0x7fefffb02 is on thread 1's stack
    ==15636==
    ==15636==
    ==15636== 1 errors in context 2 of 3:
    ==15636== Syscall param ioctl(SIOCSIF*ADDR) points to uninitialised byte(s)
    ==15636==    at 0x403EB1: __syscall_common (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
    ==15636==    by 0x40180D: netdev_setaddress (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
    ==15636==    by 0x30687464: ???
    ==15636==  Address 0x7fefffb02 is on thread 1's stack
    ==15636==
    ==15636==
    ==15636== 1 errors in context 3 of 3:
    ==15636== Syscall param ioctl(SIOCSIF*ADDR) points to uninitialised byte(s)
    ==15636==    at 0x403EB1: __syscall_common (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
    ==15636==    by 0x4017C8: netdev_setaddress (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
    ==15636==    by 0x30687464: ???
    ==15636==  Address 0x7fefffb02 is on thread 1's stack
    ==15636==
    ==15636== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)
    
    Signed-off-by: maximilian attems <max at stro.at>

diff --git a/usr/kinit/ipconfig/netdev.c b/usr/kinit/ipconfig/netdev.c
index 6e3014f..e203d0c 100644
--- a/usr/kinit/ipconfig/netdev.c
+++ b/usr/kinit/ipconfig/netdev.c
@@ -43,6 +43,7 @@ static int netdev_sif_addr(struct ifreq *ifr, int cmd, uint32_t addr)
 {
 	struct sockaddr_in sin;
 
+	memset(&sin, 0, sizeof(sin));
 	sin.sin_family = AF_INET;
 	sin.sin_addr.s_addr = addr;
 

commit 593b0aa4c9fcfbec7780d9a5c02e8f9942f7387e
Author: maximilian attems <max at stro.at>
Date:   Wed Jun 30 15:45:13 2010 +0200

    [klibc] ipconfig: packet_send() fix uninitialized valgrind errors
    
    Be conversvative and don't use C99 features, just memset the sll struct.
    The relevant sll entries are assigned later down the road.
    Rewrite struct msghdr msg assignments to not mix declarations and
    assignements.
    
    Fixes this valgrind errors:
    ==3319==
    ==3319== 1 errors in context 3 of 4:
    ==3319== Syscall param ioctl(SIOCSIF*ADDR) points to uninitialised byte(s)
    ==3319==    at 0x403BE1: __syscall_common (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
    ==3319==    by 0x401724: netdev_setaddress (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
    ==3319==    by 0x30687464: ???
    ==3319==  Address 0x7fefffb02 is on thread 1's stack
    ==3319==
    ==3319==
    ==3319== 2 errors in context 4 of 4:
    ==3319== Syscall param ÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝ points to uninitialised byte(s)
    ==3319==    at 0x403BE1: __syscall_common (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
    ==3319==    by 0x401B90: packet_send (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
    ==3319==    by 0x7FEFFFA0F: ???
    ==3319==    by 0x13: ???
    ==3319==    by 0x6060DF: ??? (in /home/maks/src/klibc-latest/usr/kinit/ipconfig/static/ipconfig.g)
    ==3319==    by 0x5: ???
    ==3319==  Address 0x7fefffa22 is on thread 1's stack
    
    Signed-off-by: maximilian attems <max at stro.at>

diff --git a/usr/kinit/ipconfig/packet.c b/usr/kinit/ipconfig/packet.c
index 508c7ba..d242457 100644
--- a/usr/kinit/ipconfig/packet.c
+++ b/usr/kinit/ipconfig/packet.c
@@ -114,17 +114,18 @@ static char *ntoa(uint32_t addr)
 int packet_send(struct netdev *dev, struct iovec *iov, int iov_len)
 {
 	struct sockaddr_ll sll;
-	struct msghdr msg = {
-		.msg_name	= &sll,
-		.msg_namelen	= sizeof(sll),
-		.msg_iov	= iov,
-		.msg_iovlen	= iov_len,
-		.msg_control	= NULL,
-		.msg_controllen	= 0,
-		.msg_flags	= 0
-	};
+	struct msghdr msg;
 	int i, len = 0;
 
+	memset(&sll, 0, sizeof(sll));
+	msg.msg_name = &sll;
+	msg.msg_namelen = sizeof(sll);
+	msg.msg_iov = iov;
+	msg.msg_iovlen = iov_len;
+	msg.msg_control = NULL;
+	msg.msg_controllen = 0;
+	msg.msg_flags = 0;
+
 	if (cfg_local_port != LOCAL_PORT) {
 		ipudp_hdrs.udp.source = htons(cfg_local_port);
 		ipudp_hdrs.udp.dest = htons(cfg_remote_port);

commit 617cba04b94cae042f71eb37c0a620587783a660
Author: Mike Waychison <mikew at google.com>
Date:   Mon Jun 7 16:30:34 2010 -0700

    [klibc] Add ancillary data structures and macros to sys/socket.h
    
    It turns out that all the CMSG_* structures and macros are hidden behind
    __KERNEL__ in current kernel.org kernels.  Expose these macros in sys/socket.h
    for the time being to make them available.
    
    Signed-off-by: Mike Waychison <mikew at google.com>
    Signed-off-by: maximilian attems <max at stro.at>

diff --git a/usr/include/sys/socket.h b/usr/include/sys/socket.h
index c69caaf..53b7ea4 100644
--- a/usr/include/sys/socket.h
+++ b/usr/include/sys/socket.h
@@ -159,6 +159,86 @@ struct msghdr {
 	unsigned msg_flags;
 };
 
+/* Ancillary data structures and cmsg macros are also hidden under __KERNEL__ */
+#ifndef CMSG_FIRSTHDR
+/*
+ *	POSIX 1003.1g - ancillary data object information
+ *	Ancillary data consits of a sequence of pairs of
+ *	(cmsghdr, cmsg_data[])
+ */
+
+struct cmsghdr {
+	__kernel_size_t	cmsg_len;	/* data byte count, including hdr */
+        int		cmsg_level;	/* originating protocol */
+        int		cmsg_type;	/* protocol-specific type */
+};
+
+/*
+ *	Ancilliary data object information MACROS
+ *	Table 5-14 of POSIX 1003.1g
+ */
+
+#define __CMSG_NXTHDR(ctl, len, cmsg) __cmsg_nxthdr((ctl),(len),(cmsg))
+#define CMSG_NXTHDR(mhdr, cmsg) cmsg_nxthdr((mhdr), (cmsg))
+
+#define CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) )
+
+#define CMSG_DATA(cmsg)	((void *)((char *)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))))
+#define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len))
+#define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
+
+#define __CMSG_FIRSTHDR(ctl,len) ((len) >= sizeof(struct cmsghdr) ? \
+				  (struct cmsghdr *)(ctl) : \
+				  (struct cmsghdr *)NULL)
+#define CMSG_FIRSTHDR(msg)	__CMSG_FIRSTHDR((msg)->msg_control, (msg)->msg_controllen)
+#define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) && \
+			     (cmsg)->cmsg_len <= (unsigned long) \
+			     ((mhdr)->msg_controllen - \
+			      ((char *)(cmsg) - (char *)(mhdr)->msg_control)))
+
+/*
+ *	Get the next cmsg header
+ *
+ *	PLEASE, do not touch this function. If you think, that it is
+ *	incorrect, grep kernel sources and think about consequences
+ *	before trying to improve it.
+ *
+ *	Now it always returns valid, not truncated ancillary object
+ *	HEADER. But caller still MUST check, that cmsg->cmsg_len is
+ *	inside range, given by msg->msg_controllen before using
+ *	ancillary object DATA.				--ANK (980731)
+ */
+
+static inline struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size,
+					       struct cmsghdr *__cmsg)
+{
+	struct cmsghdr * __ptr;
+
+	__ptr = (struct cmsghdr*)(((unsigned char *) __cmsg) +  CMSG_ALIGN(__cmsg->cmsg_len));
+	if ((unsigned long)((char*)(__ptr+1) - (char *) __ctl) > __size)
+		return (struct cmsghdr *)0;
+
+	return __ptr;
+}
+
+static inline struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg)
+{
+	return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);
+}
+
+/* "Socket"-level control message types: */
+
+#define	SCM_RIGHTS	0x01		/* rw: access rights (array of int) */
+#define SCM_CREDENTIALS 0x02		/* rw: struct ucred		*/
+#define SCM_SECURITY	0x03		/* rw: security label		*/
+
+struct ucred {
+	__u32	pid;
+	__u32	uid;
+	__u32	gid;
+};
+#endif /* CMSG_FIRSTHDR */
+
 
 __extern int socket(int, int, int);
 __extern int bind(int, struct sockaddr *, int);

commit 23d04ca085b97f8075b0e2296e5488525c5f2da5
Author: Mike Waychison <mikew at google.com>
Date:   Wed May 26 16:40:01 2010 -0700

    [klibc] CFLAGS: enable -fwrapv
    
    Enable -fwrapv in klibc's build as there may be places that assume that signed
    integers can overflow.
    
    Signed-off-by: Mike Waychison <mikew at google.com>
    
    [ I noticed no new warning on klibc build with gcc 4.4. ]
    
    Signed-off-by: maximilian attems <max at stro.at>

diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc
index 21e521f..79d196f 100644
--- a/scripts/Kbuild.klibc
+++ b/scripts/Kbuild.klibc
@@ -66,7 +66,8 @@ include $(srctree)/scripts/Kbuild.include
 # Defines used when compiling early userspace (klibc programs)
 # ---------------------------------------------------------------------------
 
-KLIBCREQFLAGS     := $(call cc-option, -fno-stack-protector, )
+KLIBCREQFLAGS     := $(call cc-option, -fno-stack-protector, ) \
+                     $(call cc-option, -fwrapv, )
 KLIBCARCHREQFLAGS :=
 KLIBCOPTFLAGS     :=
 KLIBCWARNFLAGS    := -W -Wall -Wno-sign-compare -Wno-unused-parameter

commit 021a3d610276e41e7f95a7469bdc0ea6205162de
Author: Benjamin Cama <benoar at free.fr>
Date:   Sun Apr 25 22:39:05 2010 +0200

    [klibc] fstype: btrfs size endianness fix
    
    Tested OK on both little endian (amd64) and big endian (powerpc).
    
    Signed-off-by: Benjamin Cama <benoar at free.fr>
    Signed-off-by: maximilian attems <max at stro.at>

diff --git a/usr/kinit/fstype/fstype.c b/usr/kinit/fstype/fstype.c
index d57b937..451d60c 100644
--- a/usr/kinit/fstype/fstype.c
+++ b/usr/kinit/fstype/fstype.c
@@ -460,7 +460,7 @@ static int btrfs_image(const void *buf, unsigned long long *bytes)
 	    (const struct btrfs_super_block *)buf;
 
 	if (!memcmp(sb->magic, BTRFS_MAGIC, BTRFS_MAGIC_L)) {
-		*bytes = sb->total_bytes;
+		*bytes = (unsigned long long)__le64_to_cpu(sb->total_bytes);
 		return 1;
 	}
 	return 0;

commit 529d9d2653e0a7ea8073b4c9c7a15504c44800be
Author: Aurelien Jarno <aurel32 at debian.org>
Date:   Fri Apr 16 18:17:58 2010 +0200

    [klibc] sh4: syscalls fixes
    
    Using the patch from bug #574834 klibc now builds, but does not work. It
    assumes that the kernel returns the result of the syscalls in register
    r3, while it behaves like a normal call, with the results in register
    r0.
    
    Also the pipe syscall needs a special handling as on some other
    architectures, the structure passed in argument is not filled, instead
    the two fd are returned in r0 and r1.
    
    The patch below fixes the problem. It has been tested by creating an
    initrd with initramfs and booting the system with it.
    
    Closes: #578076
    
    Signed-off-by: maximilian attems <max at stro.at>

diff --git a/usr/klibc/SYSCALLS.def b/usr/klibc/SYSCALLS.def
index e395119..437dfa7 100644
--- a/usr/klibc/SYSCALLS.def
+++ b/usr/klibc/SYSCALLS.def
@@ -115,7 +115,7 @@ int fchmod(int, mode_t);
 int mkdir(const char *, mode_t);
 <?> int mkdirat(int, const char *, const char *, mode_t);
 int rmdir(const char *);
-<!alpha,ia64,mips,mips64,sparc,sparc64> int pipe(int *);
+<!alpha,ia64,mips,mips64,sh,sparc,sparc64> int pipe(int *);
 mode_t umask(mode_t);
 int chroot(const char *);
 int symlink(const char *, const char *);
diff --git a/usr/klibc/arch/sh/Kbuild b/usr/klibc/arch/sh/Kbuild
index ab7ad5a..29b606a 100644
--- a/usr/klibc/arch/sh/Kbuild
+++ b/usr/klibc/arch/sh/Kbuild
@@ -2,7 +2,7 @@
 # klibc files for sh
 #
 
-klib-y := setjmp.o syscall.o
+klib-y := pipe.o setjmp.o syscall.o
 
 always  := crt0.o
 targets := crt0.o
diff --git a/usr/klibc/arch/sh/pipe.S b/usr/klibc/arch/sh/pipe.S
new file mode 100644
index 0000000..01b055b
--- /dev/null
+++ b/usr/klibc/arch/sh/pipe.S
@@ -0,0 +1,35 @@
+/*
+ * arch/sh/pipe.S
+ *
+ * The pipe system call is special on sh: it returns
+ * the two file descriptors in r0 and r1.
+ */
+
+#include <asm/unistd.h>
+
+	.section ".text.syscall","ax"
+	.align	2
+	.globl	pipe
+	.type	pipe, at function
+pipe:
+	mov	#__NR_pipe, r3
+	trapa	#0x10
+	mov.l	1f,r2
+	cmp/hs	r0,r2
+	bt/s	3f
+	  neg	r0,r2
+	mov.l	2f,r3
+	mov.l	r2, at r3
+	rts
+	  mov	#-1,r0
+3:
+	mov.l   r0, @r4
+	mov.l   r1, @(4, r4)
+	rts
+	  mov	#0,r0
+
+	.align 2
+1:	.long	-4096		/* Errno limit */
+2:	.long	errno
+
+	.size	pipe,.-pipe
diff --git a/usr/klibc/arch/sh/syscall.S b/usr/klibc/arch/sh/syscall.S
index f5f85cc..77245b7 100644
--- a/usr/klibc/arch/sh/syscall.S
+++ b/usr/klibc/arch/sh/syscall.S
@@ -5,7 +5,7 @@
  * r4..r7 contain arguments 0-3 per the standard calling convention,
  * and arguments 4-5 are passed in r0 and r1.
  *
- * The return value is in r3 rather than standard r0.
+ * The return value is in r0.
  */
 
 	.section ".text.syscall","ax"
@@ -16,17 +16,17 @@ __syscall_common:
 	mov.l	@(0,sp),r0
 	mov.l	@(4,sp),r1
 	trapa	#0x15
-	mov.l	1f,r0
-	cmp/hs	r0,r3
+	mov.l	1f,r1
+	cmp/hs	r0,r1
 	bt/s	3f
-	  neg	r3,r4
-	mov.l	2f,r5
-	mov.l	r4, at r5
+	  neg	r0,r1
+	mov.l	2f,r2
+	mov.l	r1, at r2
 	rts
 	  mov	#-1,r0
 3:
 	rts
-	  mov	r3,r0
+	  nop
 
 	.align 2
 1:	.long	-4096		/* Errno limit */

commit 9736adf3ea2100e12299b9e7e292a58f5d6863f6
Author: maximilian attems <max at stro.at>
Date:   Sat Apr 10 16:24:52 2010 +0200

    [klibc] fstype: list the includes in alphabetic order
    
    currently there is no order.
    
    Signed-off-by: maximilian attems <max at stro.at>

diff --git a/usr/kinit/fstype/fstype.c b/usr/kinit/fstype/fstype.c
index 6aa82fc..d57b937 100644
--- a/usr/kinit/fstype/fstype.c
+++ b/usr/kinit/fstype/fstype.c
@@ -23,20 +23,20 @@
 
 #define cpu_to_be32(x) __cpu_to_be32(x)	/* Needed by romfs_fs.h */
 
-#include "romfs_fs.h"
+#include "btrfs.h"
 #include "cramfs_fs.h"
-#include "minix_fs.h"
 #include "ext2_fs.h"
 #include "ext3_fs.h"
-#include "xfs_sb.h"
+#include "gfs2_fs.h"
+#include "iso9660_sb.h"
 #include "luks_fs.h"
 #include "lvm2_sb.h"
-#include "iso9660_sb.h"
-#include "squashfs_fs.h"
-#include "gfs2_fs.h"
-#include "ocfs2_fs.h"
+#include "minix_fs.h"
 #include "nilfs_fs.h"
-#include "btrfs.h"
+#include "ocfs2_fs.h"
+#include "romfs_fs.h"
+#include "squashfs_fs.h"
+#include "xfs_sb.h"
 
 /*
  * Slightly cleaned up version of jfs_superblock to

commit 6f57aca803ba81697099a8d38eb193459fecc894
Author: maximilian attems <max at stro.at>
Date:   Sat Apr 10 16:22:55 2010 +0200

    [klibc] bootp_packet.h minor stylistic fix
    
    Signed-off-by: maximilian attems <max at stro.at>

diff --git a/usr/kinit/ipconfig/bootp_packet.h b/usr/kinit/ipconfig/bootp_packet.h
index 3525ec3..6016e5f 100644
--- a/usr/kinit/ipconfig/bootp_packet.h
+++ b/usr/kinit/ipconfig/bootp_packet.h
@@ -28,4 +28,4 @@ struct bootp_hdr {
 	/* 312 bytes of extensions */
 };
 
-#endif
+#endif /* BOOTP_PACKET_H */

commit f0edd251485dcb3111466307ca8d9c9d74467b19
Author: maximilian attems <max at stro.at>
Date:   Mon Apr 5 04:18:09 2010 +0200

    [klibc] resume: silence warning on resume try
    
    We most propably didn't hibernate in the first place.
    
    s/fprintf/dprintf/
    
    Signed-off-by: maximilian attems <max at stro.at>

diff --git a/usr/kinit/resume/resumelib.c b/usr/kinit/resume/resumelib.c
index 5233e7e..32954bb 100644
--- a/usr/kinit/resume/resumelib.c
+++ b/usr/kinit/resume/resumelib.c
@@ -77,7 +77,7 @@ int resume(const char *resume_file, unsigned long long resume_offset)
 failure:
 	if (powerfd >= 0)
 		close(powerfd);
-	fprintf(stderr, "kinit: No resume image, doing normal boot...\n");
+	dprintf("kinit: No resume image, doing normal boot...\n");
 	return -1;
 
 fail_r:

commit fcceed7687bde392831c8eefa4c36600ce837fac
Author: Thorsten Glaser <tg at mirbsd.de>
Date:   Sat Mar 13 19:36:33 2010 +0100

    [klibc] add getrusage()
    
    we define rusage, but had no way to see this stats.
    it may allow compiling mksh against klibc.
    
    Signed-off-by: maximilian attems <max at stro.at>

diff --git a/usr/include/sys/resource.h b/usr/include/sys/resource.h
index 41cefb4..5d8bd52 100644
--- a/usr/include/sys/resource.h
+++ b/usr/include/sys/resource.h
@@ -12,4 +12,6 @@
 __extern int getpriority(int, int);
 __extern int setpriority(int, int, int);
 
+__extern int getrusage(int, struct rusage *);
+
 #endif				/* _SYS_RESOURCE_H */
diff --git a/usr/klibc/SYSCALLS.def b/usr/klibc/SYSCALLS.def
index f81452c..e395119 100644
--- a/usr/klibc/SYSCALLS.def
+++ b/usr/klibc/SYSCALLS.def
@@ -47,6 +47,7 @@ int execve(const char *, char * const *, char * const *);
 <alpha,ia64> int getpriority(int, int);
 <!alpha,ia64> int getpriority::__getpriority(int, int);
 int setpriority(int, int, int);
+int getrusage(int, struct rusage *);
 int sched_setscheduler(pid_t, int, const struct sched_param *);
 int sched_yield();
 <i386> int prctl at varadic(int, unsigned long, unsigned long, unsigned long, unsigned long);



More information about the klibc mailing list