diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2010-08-06 09:04:49 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2010-08-06 11:37:20 +0000 |
commit | 6456133f3fb46ce389b47db2718dd50f5ec1ed60 (patch) | |
tree | fa12d8d1366aec85e2e59a88d0139e95538d22bc | |
parent | 3a138c7fc3c38433f75cf3d44a4a78d80a6da705 (diff) | |
download | alpine_aports-6456133f3fb46ce389b47db2718dd50f5ec1ed60.tar.bz2 alpine_aports-6456133f3fb46ce389b47db2718dd50f5ec1ed60.tar.xz alpine_aports-6456133f3fb46ce389b47db2718dd50f5ec1ed60.zip |
main/libc0.9.32: new snapshot
has most of our fixes and fixes for new bugs
-rw-r--r-- | main/libc0.9.32/0001-config-parser-fix-memory-corruption.patch | 45 | ||||
-rw-r--r-- | main/libc0.9.32/0001-nptl-fix-calling-convention-for-__pthread_mutex_cond.patch | 73 | ||||
-rw-r--r-- | main/libc0.9.32/APKBUILD | 16 | ||||
-rw-r--r-- | main/libc0.9.32/no-posix-spawn.patch | 24 | ||||
-rw-r--r-- | main/libc0.9.32/uclibc-gcc-workaround.patch | 58 | ||||
-rw-r--r-- | main/libc0.9.32/uclibc-lutimes.patch | 105 |
6 files changed, 125 insertions, 196 deletions
diff --git a/main/libc0.9.32/0001-config-parser-fix-memory-corruption.patch b/main/libc0.9.32/0001-config-parser-fix-memory-corruption.patch new file mode 100644 index 0000000000..58acfb4234 --- /dev/null +++ b/main/libc0.9.32/0001-config-parser-fix-memory-corruption.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | From 80bcb7a4806b27397629cf2e6bcbb7e8a0c5db5b Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> | ||
3 | Date: Fri, 6 Aug 2010 11:29:38 +0300 | ||
4 | Subject: [PATCH] config parser: fix memory corruption | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | fgets will happily write over allocated area limits. Adjusted the | ||
10 | buffer size according to how much is already read. | ||
11 | |||
12 | Also increase the maximum default line length, as 80 is slightly | ||
13 | small. It might be better if bb_get_chunk_with_continuation would | ||
14 | reallocate the line buffer if it was not user given. | ||
15 | |||
16 | Signed-off-by: Timo Teräs <timo.teras@iki.fi> | ||
17 | --- | ||
18 | libc/misc/internals/parse_config.c | 4 ++-- | ||
19 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
20 | |||
21 | diff --git a/libc/misc/internals/parse_config.c b/libc/misc/internals/parse_config.c | ||
22 | index cbb6ef7..8404d80 100644 | ||
23 | --- a/libc/misc/internals/parse_config.c | ||
24 | +++ b/libc/misc/internals/parse_config.c | ||
25 | @@ -60,7 +60,7 @@ static off_t bb_get_chunk_with_continuation(parser_t* parsr) | ||
26 | char *chp; | ||
27 | |||
28 | while (1) { | ||
29 | - if (fgets(parsr->line + pos, parsr->line_len, parsr->fp) == NULL) { | ||
30 | + if (fgets(parsr->line + pos, parsr->line_len - pos, parsr->fp) == NULL) { | ||
31 | memset(parsr->line, 0, parsr->line_len); | ||
32 | pos = -1; | ||
33 | break; | ||
34 | @@ -179,7 +179,7 @@ int attribute_hidden FAST_FUNC config_read(parser_t *parser, char ***tokens, | ||
35 | again: | ||
36 | if (parser->data == NULL) { | ||
37 | if (parser->line_len == 0) | ||
38 | - parser->line_len = 81; | ||
39 | + parser->line_len = 161; | ||
40 | if (parser->data_len == 0) | ||
41 | parser->data_len += 1 + ntokens * sizeof(char *); | ||
42 | parser->data = realloc(parser->data, | ||
43 | -- | ||
44 | 1.7.0.4 | ||
45 | |||
diff --git a/main/libc0.9.32/0001-nptl-fix-calling-convention-for-__pthread_mutex_cond.patch b/main/libc0.9.32/0001-nptl-fix-calling-convention-for-__pthread_mutex_cond.patch new file mode 100644 index 0000000000..55edc51c9a --- /dev/null +++ b/main/libc0.9.32/0001-nptl-fix-calling-convention-for-__pthread_mutex_cond.patch | |||
@@ -0,0 +1,73 @@ | |||
1 | From ed8017b08bee868eb5ea11c0b57074875267a3f1 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> | ||
3 | Date: Fri, 6 Aug 2010 13:26:25 +0300 | ||
4 | Subject: [PATCH] nptl: fix calling convention for __pthread_mutex_cond_lock | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | The assembly versions of pthread_cond_wait calls | ||
10 | __pthread_mutex_cond_lock and __pthread_mutex_cond_lock_adjust | ||
11 | using internal calling convention (which differs from default | ||
12 | calling convention at least on x86). Thus these two functions | ||
13 | must be defined with internal_function or the call sequence goes | ||
14 | wrong. | ||
15 | |||
16 | __pthread_mutex_cond_lock resides in | ||
17 | sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c, but it does | ||
18 | evil macro definitions and includes pthread_mutex_lock.c, so | ||
19 | we need to add some extra kludge to pthread_mutex_lock.c to get | ||
20 | the prototypes correctly. | ||
21 | |||
22 | Signed-off-by: Timo Teräs <timo.teras@iki.fi> | ||
23 | --- | ||
24 | libpthread/nptl/pthreadP.h | 6 ++++-- | ||
25 | libpthread/nptl/pthread_mutex_lock.c | 7 ++++++- | ||
26 | 2 files changed, 10 insertions(+), 3 deletions(-) | ||
27 | |||
28 | diff --git a/libpthread/nptl/pthreadP.h b/libpthread/nptl/pthreadP.h | ||
29 | index 85601d4..c45bd11 100644 | ||
30 | --- a/libpthread/nptl/pthreadP.h | ||
31 | +++ b/libpthread/nptl/pthreadP.h | ||
32 | @@ -414,8 +414,10 @@ extern int __pthread_mutex_trylock (pthread_mutex_t *_mutex); | ||
33 | extern int __pthread_mutex_lock (pthread_mutex_t *__mutex); | ||
34 | extern int __pthread_mutex_lock_internal (pthread_mutex_t *__mutex) | ||
35 | attribute_hidden; | ||
36 | -extern int __pthread_mutex_cond_lock (pthread_mutex_t *__mutex); | ||
37 | -extern void __pthread_mutex_cond_lock_adjust (pthread_mutex_t *__mutex); | ||
38 | +extern int __pthread_mutex_cond_lock (pthread_mutex_t *__mutex) | ||
39 | + attribute_hidden internal_function; | ||
40 | +extern void __pthread_mutex_cond_lock_adjust (pthread_mutex_t *__mutex) | ||
41 | + attribute_hidden internal_function; | ||
42 | extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex); | ||
43 | extern int __pthread_mutex_unlock_internal (pthread_mutex_t *__mutex) | ||
44 | attribute_hidden; | ||
45 | diff --git a/libpthread/nptl/pthread_mutex_lock.c b/libpthread/nptl/pthread_mutex_lock.c | ||
46 | index 78b6671..77147db 100644 | ||
47 | --- a/libpthread/nptl/pthread_mutex_lock.c | ||
48 | +++ b/libpthread/nptl/pthread_mutex_lock.c | ||
49 | @@ -42,7 +42,11 @@ static int __pthread_mutex_lock_full (pthread_mutex_t *mutex) | ||
50 | |||
51 | |||
52 | int | ||
53 | +#ifdef NO_INCR | ||
54 | +attribute_hidden internal_function | ||
55 | +#else | ||
56 | attribute_protected | ||
57 | +#endif | ||
58 | __pthread_mutex_lock ( | ||
59 | pthread_mutex_t *mutex) | ||
60 | { | ||
61 | @@ -477,7 +481,8 @@ strong_alias (__pthread_mutex_lock, __pthread_mutex_lock_internal) | ||
62 | |||
63 | |||
64 | #ifdef NO_INCR | ||
65 | -void attribute_protected | ||
66 | +void | ||
67 | +attribute_hidden internal_function | ||
68 | __pthread_mutex_cond_lock_adjust ( | ||
69 | pthread_mutex_t *mutex) | ||
70 | { | ||
71 | -- | ||
72 | 1.7.0.4 | ||
73 | |||
diff --git a/main/libc0.9.32/APKBUILD b/main/libc0.9.32/APKBUILD index bb3643117d..d594deeb06 100644 --- a/main/libc0.9.32/APKBUILD +++ b/main/libc0.9.32/APKBUILD | |||
@@ -1,9 +1,9 @@ | |||
1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> | 1 | # Maintainer: Natanael Copa <ncopa@alpinelinux.org> |
2 | _abiver=0.9.32 | 2 | _abiver=0.9.32 |
3 | pkgname=libc$_abiver | 3 | pkgname=libc$_abiver |
4 | _gitver=1006300816 | 4 | _gitver=1008060645 |
5 | pkgver=${_abiver}_alpha0_git$_gitver | 5 | pkgver=${_abiver}_alpha0_git$_gitver |
6 | pkgrel=2 | 6 | pkgrel=0 |
7 | pkgdesc="C library for developing embedded Linux systems" | 7 | pkgdesc="C library for developing embedded Linux systems" |
8 | url=http://uclibc.org | 8 | url=http://uclibc.org |
9 | license="LGPL-2" | 9 | license="LGPL-2" |
@@ -18,10 +18,9 @@ _snapfile="$pkgname-$pkgver.tar.bz2" | |||
18 | source="http://build.alpinelinux.org:8010/distfiles/$_snapfile | 18 | source="http://build.alpinelinux.org:8010/distfiles/$_snapfile |
19 | compat-stack-guard.patch | 19 | compat-stack-guard.patch |
20 | uclibc-libm-pic.patch | 20 | uclibc-libm-pic.patch |
21 | uclibc-lutimes.patch | ||
22 | uclibc-resolv-tls.patch | 21 | uclibc-resolv-tls.patch |
23 | uclibc-gcc-workaround.patch | 22 | 0001-config-parser-fix-memory-corruption.patch |
24 | no-posix-spawn.patch | 23 | 0001-nptl-fix-calling-convention-for-__pthread_mutex_cond.patch |
25 | uclibcconfig.x86 | 24 | uclibcconfig.x86 |
26 | uclibcconfig.i486 | 25 | uclibcconfig.i486 |
27 | " | 26 | " |
@@ -98,12 +97,11 @@ utils() { | |||
98 | mv "$pkgdir"/usr/bin/* "$subpkgdir"/usr/bin/ | 97 | mv "$pkgdir"/usr/bin/* "$subpkgdir"/usr/bin/ |
99 | } | 98 | } |
100 | 99 | ||
101 | md5sums="b7af86c013378888fbd345c47ad21c3a libc0.9.32-0.9.32_alpha0_git1006300816.tar.bz2 | 100 | md5sums="2b3935c370307b806320e78883f9b07c libc0.9.32-0.9.32_alpha0_git1008060645.tar.bz2 |
102 | 4d408f72142ce55a0754948cc9cfe447 compat-stack-guard.patch | 101 | 4d408f72142ce55a0754948cc9cfe447 compat-stack-guard.patch |
103 | 2f9739a980be24a842c57516155c7885 uclibc-libm-pic.patch | 102 | 2f9739a980be24a842c57516155c7885 uclibc-libm-pic.patch |
104 | 4d0b8170e6580b47bf5775e65a6f081e uclibc-lutimes.patch | ||
105 | d08831b452acdeaa3037525ee617edab uclibc-resolv-tls.patch | 103 | d08831b452acdeaa3037525ee617edab uclibc-resolv-tls.patch |
106 | a88b7f394c86dc7aa606c9e338e35515 uclibc-gcc-workaround.patch | 104 | d351ca4e5c33f4a7a60d4f1d754db5c4 0001-config-parser-fix-memory-corruption.patch |
107 | cb3bfda1619a04218282cd02e3cdb4da no-posix-spawn.patch | 105 | 653b046611f98c990f1b52a28968ece3 0001-nptl-fix-calling-convention-for-__pthread_mutex_cond.patch |
108 | e2eb3bb00a0fe4d6f3d5b5c56b027bab uclibcconfig.x86 | 106 | e2eb3bb00a0fe4d6f3d5b5c56b027bab uclibcconfig.x86 |
109 | e2eb3bb00a0fe4d6f3d5b5c56b027bab uclibcconfig.i486" | 107 | e2eb3bb00a0fe4d6f3d5b5c56b027bab uclibcconfig.i486" |
diff --git a/main/libc0.9.32/no-posix-spawn.patch b/main/libc0.9.32/no-posix-spawn.patch deleted file mode 100644 index c87e564916..0000000000 --- a/main/libc0.9.32/no-posix-spawn.patch +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | commit 177538eb191c297ac146c843ff68d80ecfe9a87b | ||
2 | Author: Natanael Copa <ncopa@alpinelinux.org> | ||
3 | Date: Fri Jul 30 07:51:45 2010 +0000 | ||
4 | |||
5 | nptl: do not define _POSIX_SPAWN since its not implemented | ||
6 | |||
7 | Building things like vlc checks if _POSIX_SPAWN is defined. Since | ||
8 | posix_spawn is not implemented we dont define it. | ||
9 | |||
10 | diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h b/libpthread/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h | ||
11 | index 2550355..6fbdbb7 100644 | ||
12 | --- a/libpthread/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h | ||
13 | +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h | ||
14 | @@ -143,8 +143,10 @@ | ||
15 | /* We support spinlocks. */ | ||
16 | #define _POSIX_SPIN_LOCKS 200809L | ||
17 | |||
18 | +#if 0 | ||
19 | /* The `spawn' function family is supported. */ | ||
20 | #define _POSIX_SPAWN 200809L | ||
21 | +#endif | ||
22 | |||
23 | /* We have POSIX timers. */ | ||
24 | #define _POSIX_TIMERS 200809L | ||
diff --git a/main/libc0.9.32/uclibc-gcc-workaround.patch b/main/libc0.9.32/uclibc-gcc-workaround.patch deleted file mode 100644 index f698ecb79e..0000000000 --- a/main/libc0.9.32/uclibc-gcc-workaround.patch +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> | ||
2 | To: uclibc@uclibc.org | ||
3 | Subject: [PATCH] more workarounds for GCC PR32219 | ||
4 | Date: Wed, 30 Jun 2010 14:46:37 +0300 | ||
5 | Message-Id: <1277898397-10643-1-git-send-email-timo.teras@iki.fi> | ||
6 | X-Mailer: git-send-email 1.7.0.4 | ||
7 | MIME-Version: 1.0 | ||
8 | X-BeenThere: uclibc@uclibc.org | ||
9 | X-Mailman-Version: 2.1.12 | ||
10 | Precedence: list | ||
11 | List-Id: "Discussion and development of uClibc \(the embedded C library\)" | ||
12 | <uclibc.uclibc.org> | ||
13 | List-Unsubscribe: <http://lists.busybox.net/mailman/options/uclibc>, | ||
14 | <mailto:uclibc-request@uclibc.org?subject=unsubscribe> | ||
15 | List-Archive: <http://lists.busybox.net/pipermail/uclibc> | ||
16 | List-Post: <mailto:uclibc@uclibc.org> | ||
17 | List-Help: <mailto:uclibc-request@uclibc.org?subject=help> | ||
18 | List-Subscribe: <http://lists.busybox.net/mailman/listinfo/uclibc>, | ||
19 | <mailto:uclibc-request@uclibc.org?subject=subscribe> | ||
20 | Content-Type: text/plain; charset="utf-8" | ||
21 | Sender: uclibc-bounces@uclibc.org | ||
22 | Errors-To: uclibc-bounces@uclibc.org | ||
23 | |||
24 | Commit 2e53dd645d5348f207cec7f8595969dc566c5a55 workarounds GCC | ||
25 | bug when accessing _locale_init and _stdio_init. We need the same | ||
26 | fix for __errno_location and __h_errno_location otherwise we crash | ||
27 | calling null with static and non-threaded builds. | ||
28 | |||
29 | Signed-off-by: Timo Teräs <timo.teras@iki.fi> | ||
30 | --- | ||
31 | libc/misc/internals/__uClibc_main.c | 4 ++-- | ||
32 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
33 | |||
34 | diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c | ||
35 | index 44d1620..e8c470b 100644 | ||
36 | --- a/libc/misc/internals/__uClibc_main.c | ||
37 | +++ b/libc/misc/internals/__uClibc_main.c | ||
38 | @@ -447,11 +447,11 @@ void __uClibc_main(int (*main)(int, char **, char **), int argc, | ||
39 | * have resulted in errno being set nonzero, so set it to 0 before | ||
40 | * we call main. | ||
41 | */ | ||
42 | - if (likely(__errno_location!=NULL)) | ||
43 | + if (likely(not_null_ptr(__errno_location))) | ||
44 | *(__errno_location()) = 0; | ||
45 | |||
46 | /* Set h_errno to 0 as well */ | ||
47 | - if (likely(__h_errno_location!=NULL)) | ||
48 | + if (likely(not_null_ptr(__h_errno_location))) | ||
49 | *(__h_errno_location()) = 0; | ||
50 | |||
51 | #if defined HAVE_CLEANUP_JMP_BUF && defined __UCLIBC_HAS_THREADS_NATIVE__ | ||
52 | -- | ||
53 | 1.7.0.4 | ||
54 | |||
55 | _______________________________________________ | ||
56 | uClibc mailing list | ||
57 | uClibc@uclibc.org | ||
58 | http://lists.busybox.net/mailman/listinfo/uclibc | ||
diff --git a/main/libc0.9.32/uclibc-lutimes.patch b/main/libc0.9.32/uclibc-lutimes.patch deleted file mode 100644 index c9ec2aa475..0000000000 --- a/main/libc0.9.32/uclibc-lutimes.patch +++ /dev/null | |||
@@ -1,105 +0,0 @@ | |||
1 | From: Vladimir Zapolskiy <vzapolskiy@gmail.com> | ||
2 | To: uclibc@uclibc.org | ||
3 | Subject: [PATCH v2] lutimes: add lutimes support | ||
4 | Date: Wed, 2 Jun 2010 10:27:16 +0400 | ||
5 | Message-Id: <1275460036-3289-1-git-send-email-vzapolskiy@gmail.com> | ||
6 | X-Mailer: git-send-email 1.7.0.3 | ||
7 | In-Reply-To: <1275420197-32262-1-git-send-email-vzapolskiy@gmail.com> | ||
8 | References: <1275420197-32262-1-git-send-email-vzapolskiy@gmail.com> | ||
9 | Cc: Vladimir Zapolskiy <vzapolskiy@gmail.com> | ||
10 | X-BeenThere: uclibc@uclibc.org | ||
11 | X-Mailman-Version: 2.1.12 | ||
12 | Precedence: list | ||
13 | List-Id: "Discussion and development of uClibc \(the embedded C library\)" | ||
14 | <uclibc.uclibc.org> | ||
15 | List-Unsubscribe: <http://lists.busybox.net/mailman/options/uclibc>, | ||
16 | <mailto:uclibc-request@uclibc.org?subject=unsubscribe> | ||
17 | List-Archive: <http://lists.busybox.net/pipermail/uclibc> | ||
18 | List-Post: <mailto:uclibc@uclibc.org> | ||
19 | List-Help: <mailto:uclibc-request@uclibc.org?subject=help> | ||
20 | List-Subscribe: <http://lists.busybox.net/mailman/listinfo/uclibc>, | ||
21 | <mailto:uclibc-request@uclibc.org?subject=subscribe> | ||
22 | MIME-Version: 1.0 | ||
23 | Content-Type: text/plain; charset="us-ascii" | ||
24 | Content-Transfer-Encoding: 7bit | ||
25 | Sender: uclibc-bounces@uclibc.org | ||
26 | Errors-To: uclibc-bounces@uclibc.org | ||
27 | |||
28 | This patch adds lutimes library call support. | ||
29 | |||
30 | Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com> | ||
31 | --- | ||
32 | include/sys/time.h | 4 ++- | ||
33 | libc/sysdeps/linux/common/lutimes.c | 38 +++++++++++++++++++++++++++++++++++ | ||
34 | 2 files changed, 41 insertions(+), 1 deletions(-) | ||
35 | create mode 100644 libc/sysdeps/linux/common/lutimes.c | ||
36 | |||
37 | diff --git a/include/sys/time.h b/include/sys/time.h | ||
38 | index 33f5873..952e95a 100644 | ||
39 | --- a/include/sys/time.h | ||
40 | +++ b/include/sys/time.h | ||
41 | @@ -144,14 +144,16 @@ extern int utimes (__const char *__file, __const struct timeval __tvp[2]) | ||
42 | __THROW __nonnull ((1)); | ||
43 | libc_hidden_proto(utimes) | ||
44 | |||
45 | -#if 0 /*def __USE_BSD*/ | ||
46 | +#ifdef __USE_BSD | ||
47 | /* Same as `utimes', but does not follow symbolic links. */ | ||
48 | extern int lutimes (__const char *__file, __const struct timeval __tvp[2]) | ||
49 | __THROW __nonnull ((1)); | ||
50 | |||
51 | +#if 0 | ||
52 | /* Same as `utimes', but takes an open file descriptor instead of a name. */ | ||
53 | extern int futimes (int __fd, __const struct timeval __tvp[2]) __THROW; | ||
54 | #endif | ||
55 | +#endif | ||
56 | |||
57 | #ifdef __USE_GNU | ||
58 | /* Change the access time of FILE relative to FD to TVP[0] and the | ||
59 | diff --git a/libc/sysdeps/linux/common/lutimes.c b/libc/sysdeps/linux/common/lutimes.c | ||
60 | new file mode 100644 | ||
61 | index 0000000..0b4a8ea | ||
62 | --- /dev/null | ||
63 | +++ b/libc/sysdeps/linux/common/lutimes.c | ||
64 | @@ -0,0 +1,38 @@ | ||
65 | +/* vi: set sw=4 ts=4: */ | ||
66 | +/* | ||
67 | + * lutimes() implementation for uClibc | ||
68 | + * | ||
69 | + * Copyright (C) 2010 Vladimir Zapolskiy <vzapolskiy@gmail.com> | ||
70 | + * | ||
71 | + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. | ||
72 | + */ | ||
73 | + | ||
74 | +#include <sys/syscall.h> | ||
75 | +#include <time.h> | ||
76 | + | ||
77 | +#ifdef __NR_lutimes | ||
78 | +_syscall2(int, lutimes, const char *, file, const struct timeval *, tvp) | ||
79 | +#else | ||
80 | +#include <sys/time.h> | ||
81 | +#include <fcntl.h> | ||
82 | + | ||
83 | +int lutimes(const char *file, const struct timeval tvp[2]) | ||
84 | +{ | ||
85 | + struct timespec ts[2]; | ||
86 | + | ||
87 | + if (tvp != NULL) | ||
88 | + { | ||
89 | + if (tvp[0].tv_usec < 0 || tvp[0].tv_usec >= 1000000 | ||
90 | + || tvp[1].tv_usec < 0 || tvp[1].tv_usec >= 1000000) | ||
91 | + { | ||
92 | + __set_errno(EINVAL); | ||
93 | + return -1; | ||
94 | + } | ||
95 | + | ||
96 | + TIMEVAL_TO_TIMESPEC(&tvp[0], &ts[0]); | ||
97 | + TIMEVAL_TO_TIMESPEC(&tvp[1], &ts[1]); | ||
98 | + } | ||
99 | + | ||
100 | + return utimensat(AT_FDCWD, file, tvp ? ts : NULL, AT_SYMLINK_NOFOLLOW); | ||
101 | +} | ||
102 | +#endif | ||
103 | -- | ||
104 | 1.7.0.3 | ||
105 | |||