summaryrefslogtreecommitdiffstats
path: root/lib/libc/include
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2007-07-04 23:27:38 +0000
committerpeter <peter@FreeBSD.org>2007-07-04 23:27:38 +0000
commit1c8d4bbe1849bcdcc2f85e7f4f049e8077209ac5 (patch)
treec6557e22092cc28b77304e9185ac106ae162a5ca /lib/libc/include
parent6f011a901238459d7c02187fc3effe7157c3aeb7 (diff)
downloadFreeBSD-src-1c8d4bbe1849bcdcc2f85e7f4f049e8077209ac5.zip
FreeBSD-src-1c8d4bbe1849bcdcc2f85e7f4f049e8077209ac5.tar.gz
Change the C wrappers for mmap/lseek/pread/pwrite/truncate/ftruncate to
call the pad-less versions of the corresponding syscalls if the running kernel supports it. Check kern.osreldate once per program and cache the result to select the appropriate syscall. This maintains userland compatability with kernel.old's from quite a while back. Approved by: re (kensmith)
Diffstat (limited to 'lib/libc/include')
-rw-r--r--lib/libc/include/libc_private.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h
index a8b53fe..de4bbe4 100644
--- a/lib/libc/include/libc_private.h
+++ b/lib/libc/include/libc_private.h
@@ -169,4 +169,27 @@ void _malloc_postfork(void);
*/
extern void (*__cleanup)(void);
+/*
+ * Get kern.osreldate to detect ABI revisions. Explicitly
+ * ignores value of $OSVERSION and caches result. Prototypes
+ * for the wrapped "new" pad-less syscalls are here for now.
+ */
+extern int __getosreldate(void);
+#include <sys/_types.h>
+/* Without pad */
+extern __off_t __sys_lseek(int, __off_t, int);
+extern int __sys_ftruncate(int, __off_t);
+extern int __sys_truncate(const char *, __off_t);
+extern __ssize_t __sys_pread(int, void *, __size_t, __off_t);
+extern __ssize_t __sys_pwrite(int, const void *, __size_t, __off_t);
+extern void * __sys_mmap(void *, __size_t, int, int, int, __off_t);
+
+/* With pad */
+extern __off_t __sys_freebsd6_lseek(int, int, __off_t, int);
+extern int __sys_freebsd6_ftruncate(int, int, __off_t);
+extern int __sys_freebsd6_truncate(const char *, int, __off_t);
+extern __ssize_t __sys_freebsd6_pread(int, void *, __size_t, int, __off_t);
+extern __ssize_t __sys_freebsd6_pwrite(int, const void *, __size_t, int, __off_t);
+extern void * __sys_freebsd6_mmap(void *, __size_t, int, int, int, int, __off_t);
+
#endif /* _LIBC_PRIVATE_H_ */
OpenPOWER on IntegriCloud