Commit bc01c225 authored by Natanael Copa's avatar Natanael Copa

main/uclibc: removed. replaced with libc0.9.32

parent 3263802a
From ab443685d9f923afcdfb9fbb071a293b53aa3c40 Mon Sep 17 00:00:00 2001
From: Natanael Copa <natanael.copa@gmail.com>
Date: Sun, 13 Sep 2009 09:53:09 +0000
Subject: [PATCH] Add dn_skipname() from OpenBSD
dn_skipname() is needed by a few applications like yate, wine, kde and
probably more.
---
libresolv/resolv.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 85 insertions(+), 0 deletions(-)
diff --git a/libresolv/resolv.c b/libresolv/resolv.c
index 38b10ff..c55046d 100644
--- a/libresolv/resolv.c
+++ b/libresolv/resolv.c
@@ -7,7 +7,9 @@
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+#include <sys/types.h>
#include <features.h>
+#include <resolv.h>
void __stub1(void);
void __stub1(void)
@@ -16,3 +18,86 @@ void __stub1(void)
}
link_warning (__stub1, "the `libresolv' library is a stub. Do you really need it?")
+/* taken from OpenBSD source */
+/*
+ * ++Copyright++ 1985, 1993
+ * -
+ * Copyright (c) 1985, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * -
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ * -
+ * --Copyright--
+ */
+
+/*
+ * Skip over a compressed domain name. Return the size or -1.
+ */
+int
+__dn_skipname(const u_char *comp_dn, const u_char *eom)
+{
+ const u_char *cp;
+ int n;
+
+ cp = comp_dn;
+ while (cp < eom && (n = *cp++)) {
+ /*
+ * check for indirection
+ */
+ switch (n & INDIR_MASK) {
+ case 0: /* normal case, n == len */
+ cp += n;
+ continue;
+ case INDIR_MASK: /* indirection */
+ cp++;
+ break;
+ default: /* illegal type */
+ return (-1);
+ }
+ break;
+ }
+ if (cp > eom)
+ return (-1);
+ return (cp - comp_dn);
+}
+
--
1.6.4.2
From 85bc04d5436ca6c8a30a1ad28862260a04b8b3d5 Mon Sep 17 00:00:00 2001
From: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Date: Wed, 16 Dec 2009 13:16:08 +0100
Subject: [PATCH 1/9] avr32: add varargs handling of prctl syscall
prctl is defined to use varargs in the header file, hence it needs varargs
specific handling in the source. This patch properly handles the variodic
argument before the syscall is passed to the kernel for the AVR32 architecture.
Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
---
libc/sysdeps/linux/avr32/Makefile.arch | 2 +-
libc/sysdeps/linux/avr32/prctl.c | 36 ++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+), 1 deletions(-)
create mode 100644 libc/sysdeps/linux/avr32/prctl.c
diff --git a/libc/sysdeps/linux/avr32/Makefile.arch b/libc/sysdeps/linux/avr32/Makefile.arch
index bc5f625..98b85a7 100644
--- a/libc/sysdeps/linux/avr32/Makefile.arch
+++ b/libc/sysdeps/linux/avr32/Makefile.arch
@@ -5,7 +5,7 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CSRC := brk.c clone.c mmap.c sigaction.c
+CSRC := brk.c clone.c mmap.c prctl.c sigaction.c
SSRC := __longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \
sigrestorer.S syscall.S vfork.S
diff --git a/libc/sysdeps/linux/avr32/prctl.c b/libc/sysdeps/linux/avr32/prctl.c
new file mode 100644
index 0000000..4e146e3
--- /dev/null
+++ b/libc/sysdeps/linux/avr32/prctl.c
@@ -0,0 +1,36 @@
+/*
+ * prctl syscall for AVR32 Linux.
+ *
+ * Copyright (C) 2010 Atmel Corporation
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser General
+ * Public License. See the file "COPYING.LIB" in the main directory of this
+ * archive for more details.
+ */
+#include <sys/syscall.h>
+#include <sys/prctl.h>
+#include <stdarg.h>
+
+#ifdef __NR_prctl
+#define __NR___syscall_prctl __NR_prctl
+static inline _syscall5(int, __syscall_prctl, int, option, long, arg2,
+ long, arg3, long, arg4, long, arg5);
+
+int prctl(int __option, ...)
+{
+ long arg2;
+ long arg3;
+ long arg4;
+ long arg5;
+ va_list ap;
+
+ va_start(ap, __option);
+ arg2 = va_arg(ap, long);
+ arg3 = va_arg(ap, long);
+ arg4 = va_arg(ap, long);
+ arg5 = va_arg(ap, long);
+ va_end(ap);
+
+ return INLINE_SYSCALL(prctl, 5, __option, arg2, arg3, arg4, arg5);
+}
+#endif
--
1.6.6.1
From f29b6882327573ec4e694c1c852307c957d544b9 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Tue, 5 May 2009 14:10:42 +0000
Subject: [PATCH] ldd segfault fix
Fixes ldd segfault on this testcase:
extern void _dl_getenv(void);
void foo(void)
{
printf("foo: %x\n", &_dl_getenv);
}
linked as -shared
---
utils/ldd.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/utils/ldd.c b/utils/ldd.c
index 1f1dc25..2cd173c 100644
--- a/utils/ldd.c
+++ b/utils/ldd.c
@@ -576,18 +576,20 @@ static struct library *find_elf_interpreter(ElfW(Ehdr) *ehdr)
}
newlib->name = NULL;
newlib->path = NULL;
- return NULL;
+ break;
}
}
- if (newlib == NULL)
+ if (newlib == NULL) {
newlib = malloc(sizeof(struct library));
+ if (newlib)
+ newlib->next = NULL;
+ }
if (!newlib)
return NULL;
newlib->name = malloc(strlen(s) + 1);
strcpy(newlib->name, s);
newlib->path = strdup(newlib->name);
newlib->resolved = 1;
- newlib->next = NULL;
#if 0
/*printf("find_elf_interpreter is adding '%s' to '%s'\n", newlib->name, newlib->path); */
--
1.6.2.3
From 2911103dd4a03bbd3aad11eddfce524a5c9ba9b3 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 22 Jan 2010 13:00:20 +0100
Subject: [PATCH 2/9] Make use of macros from sys/asm.h in crt1.S
Needed for mips nptl to boot once again.
(cherry picked from commit 9c343fd4030dcd7a52616f365893177dded50346)
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
libc/sysdeps/linux/mips/crt1.S | 46 +++++++++++----------------------------
1 files changed, 13 insertions(+), 33 deletions(-)
diff --git a/libc/sysdeps/linux/mips/crt1.S b/libc/sysdeps/linux/mips/crt1.S
index e851d52..6a80412 100644
--- a/libc/sysdeps/linux/mips/crt1.S
+++ b/libc/sysdeps/linux/mips/crt1.S
@@ -85,29 +85,10 @@
__start:
#ifdef __PIC__
-#if _MIPS_SIM == _MIPS_SIM_ABI32
- .frame sp, 24, sp
- .set noreorder
- move $0, $31 /* Save old ra. */
- bal 10f /* Find addr of cpload. */
- nop
-10:
- .cpload $31
- move $31, $0
- .set reorder
- .cprestore 16
-#else
- move $0, $31; /* Save old ra. */
- .set noreorder
- bal 10f /* Find addr of .cpsetup. */
- nop
-10:
- .set reorder
- .cpsetup $31, $25, 10b
- move $31, $0
-#endif
+ SETUP_GPX($0)
+ SETUP_GPX64($25,$0)
#else
- la $28, _gp /* Setup GP correctly if we're non-PIC. */
+ PTR_LA $28, _gp /* Setup GP correctly if we're non-PIC. */
move $31, $0
#endif
@@ -118,18 +99,18 @@ __start:
/* Allocate space on the stack for seven arguments and
* make sure the stack is aligned to double words (8 bytes) */
+ and $29, -2 * SZREG
+
#if _MIPS_SIM == _MIPS_SIM_ABI32
- and $29, -2 * 4
- subu $29, 32
- la $7, _init /* init */
- la $8, _fini
- sw $8, 16($29) /* fini */
- sw $2, 20($29) /* rtld_fini */
- sw $29, 24($29) /* stack_end */
-#else
- and $29, -2 * PTRSIZE
+ PTR_SUBIU $29, 32
+#endif
PTR_LA $7, _init /* init */
- PTR_LA $8, _fini /* fini */
+ PTR_LA $8, _fini
+#if _MIPS_SIM == _MIPS_SIM_ABI32
+ PTR_S $8, 16($29) /* fini */
+ PTR_S $2, 20($29) /* rtld_fini */
+ PTR_S $29, 24($29) /* stack_end */
+#else
move $9, $2 /* rtld_fini */
move $10, $29 /* stack_end */
#endif
@@ -148,4 +129,3 @@ __data_start:
.weak data_start
data_start = __data_start
-
--
1.6.6.1
From 83a09cd5c9ed9afd87a7d1d17319c2fd2203ad0f Mon Sep 17 00:00:00 2001
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Date: Thu, 21 Jan 2010 10:36:13 +0100
Subject: [PATCH 3/9] rpc: fix typo in version mismatch msg
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
libc/inet/rpc/rpc_prot.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libc/inet/rpc/rpc_prot.c b/libc/inet/rpc/rpc_prot.c
index 74658e6..229f988 100644
--- a/libc/inet/rpc/rpc_prot.c
+++ b/libc/inet/rpc/rpc_prot.c
@@ -229,7 +229,7 @@ rejected (enum reject_stat rjct_stat,
{
switch (rjct_stat)
{
- case RPC_VERSMISMATCH:
+ case RPC_MISMATCH:
error->re_status = RPC_VERSMISMATCH;
return;
case AUTH_ERROR:
--
1.6.6.1
From d75ad2e129b3f22296cead3db53c784527deab60 Mon Sep 17 00:00:00 2001
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Date: Fri, 18 Sep 2009 16:07:31 +0200
Subject: [PATCH 4/9] fix make {,install_}{,host}utils
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
extra/locale/programs/locale.c | 3 +-
libc/misc/wchar/wchar.c | 88 +++++++++++++++++++++-------------------
2 files changed, 47 insertions(+), 44 deletions(-)
diff --git a/extra/locale/programs/locale.c b/extra/locale/programs/locale.c
index 462a579..dfd2029 100644
--- a/extra/locale/programs/locale.c
+++ b/extra/locale/programs/locale.c
@@ -10,10 +10,9 @@
*
*/
-
+#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <langinfo.h>
#include <unistd.h>
#ifdef __UCLIBC_HAS_GETOPT_LONG__
diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c
index 290e680..3ce884d 100644
--- a/libc/misc/wchar/wchar.c
+++ b/libc/misc/wchar/wchar.c
@@ -171,7 +171,6 @@ extern size_t _wchar_utf8sntowcs(wchar_t *__restrict pwc, size_t wn,
extern size_t _wchar_wcsntoutf8s(char *__restrict s, size_t n,
const wchar_t **__restrict src, size_t wn) attribute_hidden;
-
#endif /* _LIBC */
/**********************************************************************/
#ifdef L_btowc
@@ -1201,45 +1200,6 @@ typedef struct {
int skip_invalid_input; /* To support iconv -c option. */
} _UC_iconv_t;
-
-
-#ifdef L_iconv
-
-#include <iconv.h>
-#include <string.h>
-#include <endian.h>
-#include <byteswap.h>
-
-#if (__BYTE_ORDER != __BIG_ENDIAN) && (__BYTE_ORDER != __LITTLE_ENDIAN)
-#error unsupported endianness for iconv
-#endif
-
-#ifndef __CTYPE_HAS_8_BIT_LOCALES
-#error currently iconv requires 8 bit locales
-#endif
-#ifndef __CTYPE_HAS_UTF_8_LOCALES
-#error currently iconv requires UTF-8 locales
-#endif
-
-
-enum {
- IC_WCHAR_T = 0xe0,
- IC_MULTIBYTE = 0xe0,
-#if __BYTE_ORDER == __BIG_ENDIAN
- IC_UCS_4 = 0xec,
- IC_UTF_32 = 0xe4,
- IC_UCS_2 = 0xe2,
- IC_UTF_16 = 0xea,
-#else
- IC_UCS_4 = 0xed,
- IC_UTF_32 = 0xe5,
- IC_UCS_2 = 0xe3,
- IC_UTF_16 = 0xeb,
-#endif
- IC_UTF_8 = 2,
- IC_ASCII = 1
-};
-
/* For the multibyte
* bit 0 means swap endian
* bit 1 means 2 byte
@@ -1247,8 +1207,13 @@ enum {
*
*/
+#if defined L_iconv && defined _LIBC
+/* Used externally only by iconv utility */
extern const unsigned char __iconv_codesets[];
libc_hidden_proto(__iconv_codesets)
+#endif
+
+#if defined L_iconv || defined L_iconv_main
const unsigned char __iconv_codesets[] =
"\x0a\xe0""WCHAR_T\x00" /* superset of UCS-4 but platform-endian */
#if __BYTE_ORDER == __BIG_ENDIAN
@@ -1281,7 +1246,48 @@ const unsigned char __iconv_codesets[] =
"\x08\x02""UTF-8\x00"
"\x0b\x01""US-ASCII\x00"
"\x07\x01""ASCII"; /* Must be last! (special case to save a nul) */
+#endif
+#if defined L_iconv && defined _LIBC
libc_hidden_data_def(__iconv_codesets)
+#endif
+
+
+#ifdef L_iconv
+
+#include <iconv.h>
+#include <string.h>
+#include <endian.h>
+#include <byteswap.h>
+
+#if (__BYTE_ORDER != __BIG_ENDIAN) && (__BYTE_ORDER != __LITTLE_ENDIAN)
+#error unsupported endianness for iconv
+#endif
+
+#ifndef __CTYPE_HAS_8_BIT_LOCALES
+#error currently iconv requires 8 bit locales
+#endif
+#ifndef __CTYPE_HAS_UTF_8_LOCALES
+#error currently iconv requires UTF-8 locales
+#endif
+
+
+enum {
+ IC_WCHAR_T = 0xe0,
+ IC_MULTIBYTE = 0xe0,
+#if __BYTE_ORDER == __BIG_ENDIAN
+ IC_UCS_4 = 0xec,
+ IC_UTF_32 = 0xe4,
+ IC_UCS_2 = 0xe2,
+ IC_UTF_16 = 0xea,
+#else
+ IC_UCS_4 = 0xed,
+ IC_UTF_32 = 0xe5,
+ IC_UCS_2 = 0xe3,
+ IC_UTF_16 = 0xeb,
+#endif
+ IC_UTF_8 = 2,
+ IC_ASCII = 1
+};
/* Experimentally off - libc_hidden_proto(strcasecmp) */
@@ -1575,6 +1581,4 @@ size_t weak_function iconv(iconv_t cd, char **__restrict inbuf,
}
return nrcount;
}
-
#endif
-
--
1.6.6.1
From 47e88c04e01299f975ff23f33035d0f34a8f6787 Mon Sep 17 00:00:00 2001
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Date: Fri, 22 Jan 2010 13:32:44 +0100
Subject: [PATCH 5/9] {,host}utils depend on headers
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
Makefile.in | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 4c5aecb..ec4c28e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -436,7 +436,7 @@ ifeq ($(HAVE_SHARED),y)
fi
endif
-utils:
+utils: headers
$(Q)$(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C utils $@
# Installs helper applications, such as 'ldd' and 'ldconfig'
@@ -445,7 +445,7 @@ install_utils: utils
endif # ifeq ($(HAVE_DOT_CONFIG),y)
-hostutils:
+hostutils: headers
$(Q)$(MAKE) CROSS="$(CROSS)" CC="$(CC)" HOSTCC="$(HOSTCC)" DOTHOST=.host -C utils $@
install_hostutils: hostutils
--
1.6.6.1
From d43f068e84513ed88392df4ca27d49ad01145fd2 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Sun, 6 Sep 2009 12:12:12 -0400
Subject: [PATCH 6/9] fstatat: fix up behavior on 32/64 bit hosts
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The fstatat() syscall is a little funky in that it sometimes changes name
between 32 and 64 bit hosts, but it should always operate on a 64bit stat
structure. So for the fstatat() function, make sure we convert it from a
64bit kstat to a 32bit stat.
Along these lines, we need to restore the __xstat32_conv() function.
Reported-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
libc/sysdeps/linux/common/fstatat.c | 9 +++++++--
libc/sysdeps/linux/common/fstatat64.c | 5 +++++
libc/sysdeps/linux/common/xstatconv.c | 19 +++++++++++++++++++
libc/sysdeps/linux/common/xstatconv.h | 1 +
4 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/libc/sysdeps/linux/common/fstatat.c b/libc/sysdeps/linux/common/fstatat.c
index 149c189..33daa7c 100644
--- a/libc/sysdeps/linux/common/fstatat.c
+++ b/libc/sysdeps/linux/common/fstatat.c
@@ -10,15 +10,20 @@
#include <sys/stat.h>
#include "xstatconv.h"
+/* 64bit ports tend to favor newfstatat() */
+#ifdef __NR_newfstatat
+# define __NR_fstatat64 __NR_newfstatat
+#endif
+
#ifdef __NR_fstatat64
int fstatat(int fd, const char *file, struct stat *buf, int flag)
{
int ret;
- struct kernel_stat kbuf;
+ struct kernel_stat64 kbuf;
ret = INLINE_SYSCALL(fstatat64, 4, fd, file, &kbuf, flag);
if (ret == 0)
- __xstat_conv(&kbuf, buf);
+ __xstat32_conv(&kbuf, buf);
return ret;
}
diff --git a/libc/sysdeps/linux/common/fstatat64.c b/libc/sysdeps/linux/common/fstatat64.c
index 5ae1fad..95627af 100644
--- a/libc/sysdeps/linux/common/fstatat64.c
+++ b/libc/sysdeps/linux/common/fstatat64.c
@@ -12,6 +12,11 @@
#ifdef __UCLIBC_HAS_LFS__
+/* 64bit ports tend to favor newfstatat() */
+#ifdef __NR_newfstatat
+# define __NR_fstatat64 __NR_newfstatat
+#endif
+
#ifdef __NR_fstatat64
int fstatat64(int fd, const char *file, struct stat64 *buf, int flag)
{
diff --git a/libc/sysdeps/linux/common/xstatconv.c b/libc/sysdeps/linux/common/xstatconv.c
index e575b26..50455c6 100644
--- a/libc/sysdeps/linux/common/xstatconv.c
+++ b/libc/sysdeps/linux/common/xstatconv.c
@@ -46,6 +46,25 @@ void attribute_hidden __xstat_conv(struct kernel_stat *kbuf, struct stat *buf)
buf->st_ctim = kbuf->st_ctim;
}
+void __xstat32_conv(struct kernel_stat64 *kbuf, struct stat *buf)
+{
+ /* Convert to current kernel version of `struct stat64'. */
+ memset(buf, 0x00, sizeof(*buf));
+ buf->st_dev = kbuf->st_dev;
+ buf->st_ino = kbuf->st_ino;
+ buf->st_mode = kbuf->st_mode;
+ buf->st_nlink = kbuf->st_nlink;
+ buf->st_uid = kbuf->st_uid;
+ buf->st_gid = kbuf->st_gid;
+ buf->st_rdev = kbuf->st_rdev;
+ buf->st_size = kbuf->st_size;
+ buf->st_blksize = kbuf->st_blksize;