summaryrefslogtreecommitdiffstats
path: root/libc/include
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-02-10 15:43:56 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-02-10 15:43:56 -0800
commit9f65adf2ba3bb15feb8b7a7b3eef788df3fd270e (patch)
treec06064fc9022ef63a40f83a91292103784f49780 /libc/include
parentd37527501c85edcb3a6a7c8a0b6297d52d434897 (diff)
downloadbionic-9f65adf2ba3bb15feb8b7a7b3eef788df3fd270e.zip
bionic-9f65adf2ba3bb15feb8b7a7b3eef788df3fd270e.tar.gz
bionic-9f65adf2ba3bb15feb8b7a7b3eef788df3fd270e.tar.bz2
auto import from //branches/cupcake/...@130745
Diffstat (limited to 'libc/include')
-rw-r--r--libc/include/pthread.h6
-rw-r--r--libc/include/string.h5
-rw-r--r--libc/include/sys/stat.h4
-rw-r--r--libc/include/sys/time.h2
-rw-r--r--libc/include/sys/types.h1
-rw-r--r--libc/include/time64.h54
-rw-r--r--libc/include/unistd.h4
7 files changed, 69 insertions, 7 deletions
diff --git a/libc/include/pthread.h b/libc/include/pthread.h
index 9c40099..e3afdae 100644
--- a/libc/include/pthread.h
+++ b/libc/include/pthread.h
@@ -97,6 +97,9 @@ typedef volatile int pthread_once_t;
#define PTHREAD_PROCESS_PRIVATE 0
#define PTHREAD_PROCESS_SHARED 1
+#define PTHREAD_SCOPE_SYSTEM 0
+#define PTHREAD_SCOPE_PROCESS 1
+
/*
* Prototypes
*/
@@ -128,6 +131,9 @@ int pthread_attr_getstack(pthread_attr_t const * attr, void ** stackaddr, size_t
int pthread_attr_setguardsize(pthread_attr_t * attr, size_t guard_size);
int pthread_attr_getguardsize(pthread_attr_t const * attr, size_t * guard_size);
+int pthread_attr_setscope(pthread_attr_t *attr, int scope);
+int pthread_attr_getscope(pthread_attr_t const *attr);
+
int pthread_getattr_np(pthread_t thid, pthread_attr_t * attr);
int pthread_create(pthread_t *thread, pthread_attr_t const * attr,
diff --git a/libc/include/string.h b/libc/include/string.h
index 435923b..613dcd7 100644
--- a/libc/include/string.h
+++ b/libc/include/string.h
@@ -82,9 +82,8 @@ extern size_t strspn(const char *, const char *);
extern char* strsignal(int sig);
-/* Just declared to make libstdc++-v3 happy. */
-extern int strcoll (const char *, const char *);
-extern size_t strxfrm (char *, const char *, size_t);
+extern int strcoll(const char *, const char *);
+extern size_t strxfrm(char *, const char *, size_t);
__END_DECLS
diff --git a/libc/include/sys/stat.h b/libc/include/sys/stat.h
index 5e6363f..23ab5ae 100644
--- a/libc/include/sys/stat.h
+++ b/libc/include/sys/stat.h
@@ -71,6 +71,10 @@ struct stat {
unsigned long long st_ino;
};
+extern int chmod(const char *, mode_t);
+extern int fchmod(int, mode_t);
+extern int mkdir(const char *, mode_t);
+
extern int stat(const char *, struct stat *);
extern int fstat(int, struct stat *);
extern int lstat(const char *, struct stat *);
diff --git a/libc/include/sys/time.h b/libc/include/sys/time.h
index 4dee4da..1f010d4 100644
--- a/libc/include/sys/time.h
+++ b/libc/include/sys/time.h
@@ -56,7 +56,7 @@ extern int utimes(const char *, const struct timeval *);
#define timeradd(a, b, res) \
do { \
(res)->tv_sec = (a)->tv_sec + (b)->tv_sec; \
- (res)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
+ (res)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
if ((res)->tv_usec >= 1000000) { \
(res)->tv_usec -= 1000000; \
(res)->tv_sec += 1; \
diff --git a/libc/include/sys/types.h b/libc/include/sys/types.h
index 92b452c..b071ee9 100644
--- a/libc/include/sys/types.h
+++ b/libc/include/sys/types.h
@@ -65,6 +65,7 @@ typedef __kernel_nlink_t nlink_t;
#define _OFF_T_DEFINED_
typedef __kernel_off_t off_t;
typedef __kernel_loff_t loff_t;
+typedef loff_t off64_t; /* GLibc-specific */
typedef __kernel_pid_t pid_t;
diff --git a/libc/include/time64.h b/libc/include/time64.h
new file mode 100644
index 0000000..9da4bc7
--- /dev/null
+++ b/libc/include/time64.h
@@ -0,0 +1,54 @@
+/*
+
+Copyright (c) 2007-2008 Michael G Schwern
+
+This software originally derived from Paul Sheer's pivotal_gmtime_r.c.
+
+The MIT License:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+Origin: http://code.google.com/p/y2038
+Modified for Bionic by the Android Open Source Project
+
+*/
+#ifndef TIME64_H
+#define TIME64_H
+
+#include <time.h>
+#include <stdint.h>
+
+typedef int64_t time64_t;
+
+struct tm *gmtime64_r (const time64_t *, struct tm *);
+struct tm *localtime64_r (const time64_t *, struct tm *);
+struct tm *gmtime64 (const time64_t *);
+struct tm *localtime64 (const time64_t *);
+
+char *asctime64 (const struct tm *);
+char *asctime64_r (const struct tm *, char *);
+
+char *ctime64 (const time64_t*);
+char *ctime64_r (const time64_t*, char*);
+
+time64_t timegm64 (const struct tm *);
+time64_t mktime64 (const struct tm *);
+time64_t timelocal64 (const struct tm *);
+
+#endif /* TIME64_H */
diff --git a/libc/include/unistd.h b/libc/include/unistd.h
index b6d70cc..1ada37e 100644
--- a/libc/include/unistd.h
+++ b/libc/include/unistd.h
@@ -34,6 +34,7 @@
#include <sys/select.h>
#include <sys/sysconf.h>
#include <linux/capability.h>
+#include <pathconf.h>
__BEGIN_DECLS
@@ -111,9 +112,6 @@ extern int link(const char *, const char *);
extern int unlink(const char *);
extern int chdir(const char *);
extern int fchdir(int);
-extern int chmod(const char *, mode_t);
-extern int fchmod(int, mode_t);
-extern int mkdir(const char *, mode_t);
extern int rmdir(const char *);
extern int pipe(int *);
extern int chroot(const char *);