mirror of
https://github.com/godotengine/buildroot.git
synced 2026-01-10 10:10:28 +03:00
Compare commits
13 Commits
2012.02_rc
...
2012.02_rc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d6ff4f527 | ||
|
|
00dbf19c38 | ||
|
|
5207e68a8c | ||
|
|
7553f043ad | ||
|
|
d6628bca39 | ||
|
|
d54dc133e1 | ||
|
|
7a7bd4b873 | ||
|
|
40281284ad | ||
|
|
6a180a9a1f | ||
|
|
74c7b15a90 | ||
|
|
3c61d73209 | ||
|
|
08bd8712ef | ||
|
|
8b67554a3f |
15
CHANGES
15
CHANGES
@@ -1,4 +1,17 @@
|
||||
2012.02-rc1: Released February 12th, 2012:
|
||||
2012.02-rc2, Released February 19th, 2012:
|
||||
|
||||
Fixes all over the tree.
|
||||
|
||||
Toolchain: uClibc: Added upstream post-0.9.33 fixes, Bump
|
||||
linux-headers 3.0.x / 3.2.x stable versions.
|
||||
|
||||
Documentation: Added makedev / <pkg>_DEVICES /
|
||||
<pkg>_PERMISSIONS documentation.
|
||||
|
||||
Updated/fixed packages: busybox, ffmpeg, gst-dsp, libecore,
|
||||
libvncserver, mxml, python.
|
||||
|
||||
2012.02-rc1, Released February 12th, 2012:
|
||||
|
||||
Fixes all over the tree and new features.
|
||||
|
||||
|
||||
2
Makefile
2
Makefile
@@ -24,7 +24,7 @@
|
||||
#--------------------------------------------------------------
|
||||
|
||||
# Set and export the version string
|
||||
export BR2_VERSION:=2012.02-rc1
|
||||
export BR2_VERSION:=2012.02-rc2
|
||||
|
||||
# Check for minimal make version (note: this check will break at make 10.x)
|
||||
MIN_MAKE_VERSION=3.81
|
||||
|
||||
@@ -14,12 +14,12 @@ or
|
||||
<a href="/downloads/buildroot-2011.11.tar.bz2">buildroot-2011.11.tar.bz2</a>.
|
||||
<p>
|
||||
|
||||
The latest release candidate is <b>2012.02-rc1</b>, which can be
|
||||
The latest release candidate is <b>2012.02-rc2</b>, which can be
|
||||
downloaded here:<p>
|
||||
|
||||
<a href="/downloads/buildroot-2012.02-rc1.tar.gz">buildroot-2012.02-rc1.tar.gz</a>
|
||||
<a href="/downloads/buildroot-2012.02-rc2.tar.gz">buildroot-2012.02-rc2.tar.gz</a>
|
||||
or
|
||||
<a href="/downloads/buildroot-2012.02-rc1.tar.bz2">buildroot-2012.02-rc1.tar.bz2</a>.
|
||||
<a href="/downloads/buildroot-2012.02-rc2.tar.bz2">buildroot-2012.02-rc2.tar.bz2</a>.
|
||||
<p>
|
||||
|
||||
This and earlier releases can always be downloaded from
|
||||
|
||||
@@ -210,10 +210,13 @@ information is (assuming the package name is +libfoo+) :
|
||||
|
||||
* +LIBFOO_DEVICES+ lists the device files to be created by Buildroot
|
||||
when using the static device table. The syntax to use is the
|
||||
makedevs one.
|
||||
makedevs one. You can find some documentation for this syntax in the
|
||||
xref:makedev-syntax[]. This variable is optional.
|
||||
|
||||
* +LIBFOO_PERMISSIONS+ lists the changes of permissions to be done at
|
||||
the end of the build process. The syntax is once again the makedevs one.
|
||||
You can find some documentation for this syntax in the xref:makedev-syntax[].
|
||||
This variable is optional.
|
||||
|
||||
The recommended way to define these variables is to use the following
|
||||
syntax:
|
||||
|
||||
4
docs/manual/appendix.txt
Normal file
4
docs/manual/appendix.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
Appendix
|
||||
========
|
||||
|
||||
include::makedev-syntax.txt[]
|
||||
54
docs/manual/makedev-syntax.txt
Normal file
54
docs/manual/makedev-syntax.txt
Normal file
@@ -0,0 +1,54 @@
|
||||
[[makedev-syntax]]
|
||||
Makedev syntax documentation
|
||||
----------------------------
|
||||
|
||||
The makedev syntax is used across several places in Buildroot to
|
||||
define changes to be made for permissions or which device files to
|
||||
create and how to create them, in order to avoid to call mkdnod every
|
||||
now and then.
|
||||
|
||||
This syntax is derived from the makedev utility, and a more complete
|
||||
documentation can be found in the +package/makedevs/README+ file.
|
||||
|
||||
It takes the form of a line for each file, with the following layout:
|
||||
|
||||
|===========================================================
|
||||
|name |type |mode |uid |gid |major |minor |start |inc |count
|
||||
|===========================================================
|
||||
|
||||
There is a few non-trivial blocks here:
|
||||
|
||||
- +name+ is the path to the file you want to create/modify
|
||||
- +type+ is the type of the file, being one of :
|
||||
* f: a regular file
|
||||
* d: a directory
|
||||
* c: a character device file
|
||||
* b: a block device file
|
||||
* p: a named pipe
|
||||
- +mode+, +uid+ and +gid+ are the usual permissions stuff
|
||||
- +major+ and +minor+ are here for device files
|
||||
- +start+, +inc+ and +count+ are when you want to create a whole batch
|
||||
of files, and can be reduced to a loop, beginning at +start+,
|
||||
incrementing its counter by +inc+ until it reaches +count+
|
||||
|
||||
Let's say you want to change the permissions of a given file, using
|
||||
this syntax, you will need to put:
|
||||
-------------------------------------------------------------------
|
||||
/usr/bin/foobar f 644 0 0 - - - - -
|
||||
-------------------------------------------------------------------
|
||||
|
||||
On the other hand, if you want to create the device file +/dev/hda+
|
||||
and the corresponding 15 files for the partitions, you will need for
|
||||
+/dev/hda+:
|
||||
|
||||
-------------------------------------------------------------------
|
||||
/dev/hda b 640 0 0 3 0 0 0 -
|
||||
-------------------------------------------------------------------
|
||||
|
||||
and then for device files corresponding to the partitions of
|
||||
+/dev/hda+, +/dev/hdaX+, +X+ ranging from 1 to 15:
|
||||
|
||||
-------------------------------------------------------------------
|
||||
/dev/hda b 640 0 0 3 1 1 1 15
|
||||
-------------------------------------------------------------------
|
||||
|
||||
@@ -30,3 +30,5 @@ include::ccache-support.txt[]
|
||||
include::download-location.txt[]
|
||||
|
||||
include::adding-packages.txt[]
|
||||
|
||||
include::appendix.txt[]
|
||||
|
||||
@@ -5,12 +5,26 @@
|
||||
<p>
|
||||
|
||||
<ul>
|
||||
<li><b>12 December 2012 -- 2012.02-rc1 released</b>
|
||||
<li><b>19 February 2012 -- 2012.02-rc2 released</b>
|
||||
|
||||
<p>Another week, another release candidate with more cleanups and
|
||||
build fixes. See the <a
|
||||
href="http://git.buildroot.net/buildroot/plain/CHANGES?id=2012.02_rc2">CHANGES</a>
|
||||
file for details.</p>
|
||||
|
||||
<p>Head to the <a href="/downloads/">downloads page</a> to pick up the
|
||||
<a href="/downloads/buildroot-2012.02-rc2.tar.bz2">2012.02-rc2
|
||||
release candidate</a>, and report any problems found to the <a
|
||||
href="lists.html">mailing list</a> or <a
|
||||
href="https://bugs.uclibc.org">bug tracker</a>.</p>
|
||||
|
||||
<li><b>12 February 2012 -- 2012.02-rc1 released</b>
|
||||
|
||||
<p>We have a new release candidate! Lots of changes all over the
|
||||
tree, see the <a
|
||||
href="http://git.buildroot.net/buildroot/plain/CHANGES?id=2012.02_rc1">CHANGES</a>
|
||||
file for details.</p>
|
||||
file for details, and read the
|
||||
<a href="http://lists.busybox.net/pipermail/buildroot/2012-February/050234.html">announcement</a>.</p>
|
||||
|
||||
<p>Head to the <a href="/downloads/">downloads page</a> to pick up the
|
||||
<a href="/downloads/buildroot-2012.02-rc1.tar.bz2">2012.02-rc1
|
||||
|
||||
@@ -22,7 +22,7 @@ choice
|
||||
default BR2_LINUX_KERNEL_3_2
|
||||
|
||||
config BR2_LINUX_KERNEL_3_2
|
||||
bool "3.2.5"
|
||||
bool "3.2.6"
|
||||
|
||||
config BR2_LINUX_KERNEL_SAME_AS_HEADERS
|
||||
bool "Same as toolchain kernel headers"
|
||||
@@ -73,7 +73,7 @@ config BR2_LINUX_KERNEL_CUSTOM_GIT_VERSION
|
||||
|
||||
config BR2_LINUX_KERNEL_VERSION
|
||||
string
|
||||
default "3.2.5" if BR2_LINUX_KERNEL_3_2
|
||||
default "3.2.6" if BR2_LINUX_KERNEL_3_2
|
||||
default BR2_DEFAULT_KERNEL_HEADERS if BR2_LINUX_KERNEL_SAME_AS_HEADERS
|
||||
default BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE if BR2_LINUX_KERNEL_CUSTOM_VERSION
|
||||
default "custom" if BR2_LINUX_KERNEL_CUSTOM_TARBALL
|
||||
|
||||
@@ -41,7 +41,7 @@ config BR2_BUSYBOX_VERSION
|
||||
default "1.16.2" if BR2_BUSYBOX_VERSION_1_16_X
|
||||
default "1.17.4" if BR2_BUSYBOX_VERSION_1_17_X
|
||||
default "1.18.5" if BR2_BUSYBOX_VERSION_1_18_X
|
||||
default "1.19.3" if BR2_BUSYBOX_VERSION_1_19_X
|
||||
default "1.19.4" if BR2_BUSYBOX_VERSION_1_19_X
|
||||
|
||||
config BR2_PACKAGE_BUSYBOX_CONFIG
|
||||
string "BusyBox configuration file to use?"
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
--- busybox-1.19.3/loginutils/getty.c
|
||||
+++ busybox-1.19.3-getty/loginutils/getty.c
|
||||
@@ -271,7 +271,9 @@ static void termios_init(int speed)
|
||||
#ifdef CMSPAR
|
||||
| CMSPAR /* mark or space parity */
|
||||
#endif
|
||||
+#ifdef CBAUD
|
||||
| CBAUD /* (output) baud rate */
|
||||
+#endif
|
||||
#ifdef CBAUDEX
|
||||
| CBAUDEX /* (output) baud rate */
|
||||
#endif
|
||||
@@ -1,11 +0,0 @@
|
||||
--- busybox-1.19.3/util-linux/mdev.c
|
||||
+++ busybox-1.19.3-mdev/util-linux/mdev.c
|
||||
@@ -610,7 +610,7 @@ int mdev_main(int argc UNUSED_PARAM, cha
|
||||
int seqlen;
|
||||
char seqbuf[sizeof(int)*3 + 2];
|
||||
|
||||
- seqlen = open_read_close("mdev.seq", seqbuf, sizeof(seqbuf-1));
|
||||
+ seqlen = open_read_close("mdev.seq", seqbuf, sizeof(seqbuf) - 1);
|
||||
if (seqlen < 0) {
|
||||
seq = NULL;
|
||||
break;
|
||||
@@ -1,10 +0,0 @@
|
||||
--- busybox-1.19.3/modutils/modinfo.c
|
||||
+++ busybox-1.19.3-modinfo/modutils/modinfo.c
|
||||
@@ -13,6 +13,7 @@
|
||||
//config:config MODINFO
|
||||
//config: bool "modinfo"
|
||||
//config: default y
|
||||
+//config: select PLATFORM_LINUX
|
||||
//config: help
|
||||
//config: Show information about a Linux Kernel module
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
--- busybox-1.19.3/networking/wget.c
|
||||
+++ busybox-1.19.3-wget/networking/wget.c
|
||||
@@ -552,6 +552,7 @@ static void download_one_url(const char
|
||||
FILE *dfp; /* socket to ftp server (data) */
|
||||
char *proxy = NULL;
|
||||
char *fname_out_alloc;
|
||||
+ char *redirected_path = NULL;
|
||||
struct host_info server;
|
||||
struct host_info target;
|
||||
|
||||
@@ -794,8 +795,8 @@ However, in real world it was observed t
|
||||
bb_error_msg_and_die("too many redirections");
|
||||
fclose(sfp);
|
||||
if (str[0] == '/') {
|
||||
- free(target.allocated);
|
||||
- target.path = target.allocated = xstrdup(str+1);
|
||||
+ free(redirected_path);
|
||||
+ target.path = redirected_path = xstrdup(str+1);
|
||||
/* lsa stays the same: it's on the same server */
|
||||
} else {
|
||||
parse_url(str, &target);
|
||||
@@ -850,6 +851,7 @@ However, in real world it was observed t
|
||||
free(server.allocated);
|
||||
free(target.allocated);
|
||||
free(fname_out_alloc);
|
||||
+ free(redirected_path);
|
||||
}
|
||||
|
||||
int wget_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
||||
@@ -76,11 +76,10 @@ LIBECORE_DEPENDENCIES += libxcb xlib_libX11 xcb-util
|
||||
# teach it about CC_FOR_BUILD, but for now simply build makekeys by
|
||||
# hand in advance
|
||||
define LIBECORE_BUILD_MAKEKEYS_FOR_HOST
|
||||
cd $(@D)/src/util && $(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) \
|
||||
-o makekeys makekeys.c
|
||||
$(HOST_CONFIGURE_OPTS) $(MAKE1) -C $(@D)/src/util makekeys.o makekeys
|
||||
endef
|
||||
|
||||
LIBECORE_POST_CONFIGURE_HOOKS += LIBECORE_BUILD_MAKEKEYS_FOR_HOST
|
||||
LIBECORE_POST_EXTRACT_HOOKS += LIBECORE_BUILD_MAKEKEYS_FOR_HOST
|
||||
else
|
||||
LIBECORE_CONF_OPT += --disable-ecore-x-xcb
|
||||
endif
|
||||
|
||||
@@ -24,6 +24,7 @@ LIBVNCSERVER_CONF_OPT += --without-crypto
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBGCRYPT),y)
|
||||
LIBVNCSERVER_CONF_ENV += LIBGCRYPT_CONFIG=$(STAGING_DIR)/usr/bin/libgcrypt-config
|
||||
LIBVNCSERVER_DEPENDENCIES += libgcrypt
|
||||
else
|
||||
LIBVNCSERVER_CONF_OPT += --without-gcrypt
|
||||
|
||||
@@ -150,7 +150,7 @@ endif
|
||||
# Set powerpc altivec appropriately
|
||||
ifeq ($(BR2_powerpc),y)
|
||||
ifeq ($(BR2_powerpc_7400)$(BR2_powerpc_7450)$(BR2_powerpc_970),y)
|
||||
FFMPEG_CONF_OPT -= --enable-altivec
|
||||
FFMPEG_CONF_OPT += --enable-altivec
|
||||
else
|
||||
FFMPEG_CONF_OPT += --disable-altivec
|
||||
endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
GST_DSP_VERSION = 0.10.1
|
||||
GST_DSP_VERSION = 0.10.2
|
||||
GST_DSP_SITE = http://gst-dsp.googlecode.com/files/
|
||||
|
||||
define GST_DSP_BUILD_CMDS
|
||||
|
||||
@@ -7,9 +7,9 @@ MXML_VERSION = 2.6
|
||||
MXML_SITE = http://ftp.easysw.com/pub/mxml/2.6
|
||||
MXML_INSTALL_STAGING = YES
|
||||
|
||||
MXML_INSTALL_STAGING_OPT = DSTROOT=$(TARGET_DIR) install
|
||||
MXML_INSTALL_STAGING_OPT = DSTROOT=$(STAGING_DIR) install
|
||||
MXML_INSTALL_TARGET_OPT = DSTROOT=$(TARGET_DIR) install
|
||||
MXML_UNINSTALL_STAGING_OPT = DSTROOT=$(TARGET_DIR) uninstall
|
||||
MXML_UNINSTALL_STAGING_OPT = DSTROOT=$(STAGING_DIR) uninstall
|
||||
MXML_UNINSTALL_TARGET_OPT = DSTROOT=$(TARGET_DIR) uninstall
|
||||
|
||||
$(eval $(call AUTOTARGETS))
|
||||
|
||||
@@ -131,6 +131,15 @@ PYTHON_MAKE_ENV = \
|
||||
PYTHON_MODULES_INCLUDE=$(STAGING_DIR)/usr/include \
|
||||
PYTHON_MODULES_LIB="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib"
|
||||
|
||||
# python distutils adds -L$LIBDIR when linking binary extensions, causing
|
||||
# trouble for cross compilation
|
||||
define PYTHON_FIXUP_LIBDIR
|
||||
$(SED) 's|^LIBDIR=.*|LIBDIR= $(STAGING_DIR)/usr/lib|' \
|
||||
$(STAGING_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/config/Makefile
|
||||
endef
|
||||
|
||||
PYTHON_POST_INSTALL_STAGING_HOOKS += PYTHON_FIXUP_LIBDIR
|
||||
|
||||
#
|
||||
# Development files removal
|
||||
#
|
||||
|
||||
@@ -60,8 +60,8 @@ config BR2_DEFAULT_KERNEL_HEADERS
|
||||
default "2.6.37.6" if BR2_KERNEL_HEADERS_2_6_37
|
||||
default "2.6.38.8" if BR2_KERNEL_HEADERS_2_6_38
|
||||
default "2.6.39.4" if BR2_KERNEL_HEADERS_2_6_39
|
||||
default "3.0.19" if BR2_KERNEL_HEADERS_3_0
|
||||
default "3.0.21" if BR2_KERNEL_HEADERS_3_0
|
||||
default "3.1.10" if BR2_KERNEL_HEADERS_3_1
|
||||
default "3.2.5" if BR2_KERNEL_HEADERS_3_2
|
||||
default "3.2.6" if BR2_KERNEL_HEADERS_3_2
|
||||
default "2.6" if BR2_KERNEL_HEADERS_SNAP
|
||||
default $BR2_DEFAULT_KERNEL_VERSION if BR2_KERNEL_HEADERS_VERSION
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From ca457af92be7835edf77f34bead94f504fbc2d4b Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Fri, 3 Feb 2012 10:57:44 -0800
|
||||
Subject: [PATCH 2/4] Declare __err and pass it to INTERNAL_SYSCALL_NCS so
|
||||
subsequent macros can use it
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
||||
---
|
||||
libc/sysdeps/linux/common/bits/syscalls-common.h | 4 ++--
|
||||
1 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/libc/sysdeps/linux/common/bits/syscalls-common.h b/libc/sysdeps/linux/common/bits/syscalls-common.h
|
||||
index faebd1b..0f5a929 100644
|
||||
--- a/libc/sysdeps/linux/common/bits/syscalls-common.h
|
||||
+++ b/libc/sysdeps/linux/common/bits/syscalls-common.h
|
||||
@@ -59,8 +59,8 @@
|
||||
#ifndef INLINE_SYSCALL_NOERR_NCS
|
||||
# define INLINE_SYSCALL_NOERR_NCS(name, nr, args...) \
|
||||
({ \
|
||||
- /*INTERNAL_SYSCALL_DECL(__err);*/ \
|
||||
- long __res = INTERNAL_SYSCALL_NCS(name, /*__err*/, nr, args); \
|
||||
+ INTERNAL_SYSCALL_DECL(__err); \
|
||||
+ long __res = INTERNAL_SYSCALL_NCS(name, __err, nr, args); \
|
||||
__res; \
|
||||
})
|
||||
#endif
|
||||
--
|
||||
1.7.8.3
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
From b813377f6c746118a9d2625e6b29ffeec4233663 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Fri, 3 Feb 2012 20:06:55 -0800
|
||||
Subject: [PATCH 3/4] lstat/stat/fstat: Use 64bit version of syscall if
|
||||
available
|
||||
|
||||
This is needed for stat'ing loop devices > 255
|
||||
since otherwise kernel returns EOVERFLOW becasue
|
||||
it needs st_rdev/st_dev to be larger than 16bits but
|
||||
in kernel it uses __old_kernel_stat for stat
|
||||
syscall which has st_rdev/st_dev as unsigned short
|
||||
|
||||
Add a testcase
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
||||
---
|
||||
libc/sysdeps/linux/common/fstat.c | 18 ++++++++++++++----
|
||||
libc/sysdeps/linux/common/lstat.c | 19 ++++++++++++++-----
|
||||
libc/sysdeps/linux/common/stat.c | 18 ++++++++++++++----
|
||||
test/stat/stat-loop256.c | 32 ++++++++++++++++++++++++++++++++
|
||||
4 files changed, 74 insertions(+), 13 deletions(-)
|
||||
create mode 100644 test/stat/stat-loop256.c
|
||||
|
||||
diff --git a/libc/sysdeps/linux/common/fstat.c b/libc/sysdeps/linux/common/fstat.c
|
||||
index acc639b..4726a68 100644
|
||||
--- a/libc/sysdeps/linux/common/fstat.c
|
||||
+++ b/libc/sysdeps/linux/common/fstat.c
|
||||
@@ -12,18 +12,28 @@
|
||||
#include <sys/stat.h>
|
||||
#include "xstatconv.h"
|
||||
|
||||
-#define __NR___syscall_fstat __NR_fstat
|
||||
-static __inline__ _syscall2(int, __syscall_fstat, int, fd, struct kernel_stat *, buf)
|
||||
-
|
||||
int fstat(int fd, struct stat *buf)
|
||||
{
|
||||
int result;
|
||||
+#ifdef __NR_fstat64
|
||||
+ /* normal stat call has limited values for various stat elements
|
||||
+ * e.g. uid device major/minor etc.
|
||||
+ * so we use 64 variant if available
|
||||
+ * in order to get newer versions of stat elements
|
||||
+ */
|
||||
+ struct kernel_stat64 kbuf;
|
||||
+ result = INLINE_SYSCALL(fstat64, 2, fd, &kbuf);
|
||||
+ if (result == 0) {
|
||||
+ __xstat32_conv(&kbuf, buf);
|
||||
+ }
|
||||
+#else
|
||||
struct kernel_stat kbuf;
|
||||
|
||||
- result = __syscall_fstat(fd, &kbuf);
|
||||
+ result = INLINE_SYSCALL(fstat, 2, fd, &kbuf);
|
||||
if (result == 0) {
|
||||
__xstat_conv(&kbuf, buf);
|
||||
}
|
||||
+#endif
|
||||
return result;
|
||||
}
|
||||
libc_hidden_def(fstat)
|
||||
diff --git a/libc/sysdeps/linux/common/lstat.c b/libc/sysdeps/linux/common/lstat.c
|
||||
index aa77447..db72d1f 100644
|
||||
--- a/libc/sysdeps/linux/common/lstat.c
|
||||
+++ b/libc/sysdeps/linux/common/lstat.c
|
||||
@@ -12,19 +12,28 @@
|
||||
#include <sys/stat.h>
|
||||
#include "xstatconv.h"
|
||||
|
||||
-#define __NR___syscall_lstat __NR_lstat
|
||||
-static __inline__ _syscall2(int, __syscall_lstat,
|
||||
- const char *, file_name, struct kernel_stat *, buf)
|
||||
-
|
||||
int lstat(const char *file_name, struct stat *buf)
|
||||
{
|
||||
int result;
|
||||
+#ifdef __NR_lstat64
|
||||
+ /* normal stat call has limited values for various stat elements
|
||||
+ * e.g. uid device major/minor etc.
|
||||
+ * so we use 64 variant if available
|
||||
+ * in order to get newer versions of stat elements
|
||||
+ */
|
||||
+ struct kernel_stat64 kbuf;
|
||||
+ result = INLINE_SYSCALL(lstat64, 2, file_name, &kbuf);
|
||||
+ if (result == 0) {
|
||||
+ __xstat32_conv(&kbuf, buf);
|
||||
+ }
|
||||
+#else
|
||||
struct kernel_stat kbuf;
|
||||
|
||||
- result = __syscall_lstat(file_name, &kbuf);
|
||||
+ result = INLINE_SYSCALL(lstat, 2, file_name, &kbuf);
|
||||
if (result == 0) {
|
||||
__xstat_conv(&kbuf, buf);
|
||||
}
|
||||
+#endif
|
||||
return result;
|
||||
}
|
||||
libc_hidden_def(lstat)
|
||||
diff --git a/libc/sysdeps/linux/common/stat.c b/libc/sysdeps/linux/common/stat.c
|
||||
index a6ab291..829f35a 100644
|
||||
--- a/libc/sysdeps/linux/common/stat.c
|
||||
+++ b/libc/sysdeps/linux/common/stat.c
|
||||
@@ -12,20 +12,30 @@
|
||||
#include <sys/stat.h>
|
||||
#include "xstatconv.h"
|
||||
|
||||
-#define __NR___syscall_stat __NR_stat
|
||||
#undef stat
|
||||
-static __inline__ _syscall2(int, __syscall_stat,
|
||||
- const char *, file_name, struct kernel_stat *, buf)
|
||||
|
||||
int stat(const char *file_name, struct stat *buf)
|
||||
{
|
||||
int result;
|
||||
+#ifdef __NR_stat64
|
||||
+ /* normal stat call has limited values for various stat elements
|
||||
+ * e.g. uid device major/minor etc.
|
||||
+ * so we use 64 variant if available
|
||||
+ * in order to get newer versions of stat elements
|
||||
+ */
|
||||
+ struct kernel_stat64 kbuf;
|
||||
+ result = INLINE_SYSCALL(stat64, 2, file_name, &kbuf);
|
||||
+ if (result == 0) {
|
||||
+ __xstat32_conv(&kbuf, buf);
|
||||
+ }
|
||||
+#else
|
||||
struct kernel_stat kbuf;
|
||||
|
||||
- result = __syscall_stat(file_name, &kbuf);
|
||||
+ result = INLINE_SYSCALL(stat, 2, file_name, &kbuf);
|
||||
if (result == 0) {
|
||||
__xstat_conv(&kbuf, buf);
|
||||
}
|
||||
+#endif
|
||||
return result;
|
||||
}
|
||||
libc_hidden_def(stat)
|
||||
diff --git a/test/stat/stat-loop256.c b/test/stat/stat-loop256.c
|
||||
new file mode 100644
|
||||
index 0000000..14284c1
|
||||
--- /dev/null
|
||||
+++ b/test/stat/stat-loop256.c
|
||||
@@ -0,0 +1,32 @@
|
||||
+#include <stdio.h>
|
||||
+#include <unistd.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <sys/stat.h>
|
||||
+int main()
|
||||
+{
|
||||
+ struct stat statbuf;
|
||||
+ int ret = 0;
|
||||
+ char* loop255 = "/dev/loop255";
|
||||
+ char* loop256 = "/dev/loop256";
|
||||
+ mode_t mode = 0660;
|
||||
+ mknod(loop255, mode, 0x7ff);
|
||||
+ mknod(loop256, mode, 0x100700);
|
||||
+ ret = stat(loop255, &statbuf);
|
||||
+ if(ret < 0) {
|
||||
+ printf("stat: Cant stat %s\n",loop255);
|
||||
+ unlink(loop255);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ ret = stat(loop256, &statbuf);
|
||||
+ if(ret < 0) {
|
||||
+ printf("stat: Cant stat %s\n",loop256);
|
||||
+ unlink(loop255);
|
||||
+ unlink(loop256);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
+ unlink(loop255);
|
||||
+ unlink(loop256);
|
||||
+ exit(0);
|
||||
+}
|
||||
+
|
||||
--
|
||||
1.7.8.3
|
||||
|
||||
Reference in New Issue
Block a user