Date: Sat, 30 Jun 2007 23:46:14 GMT From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 122595 for review Message-ID: <200706302346.l5UNkEn8012466@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=122595 Change 122595 by peter@peter_overcee on 2007/06/30 23:45:14 Oops. Can't use getenv() in super-early ld-elf.so.1 startup. KABLAM! Switch back to __getosreldate() like I originally intended. While here, add the missing prototypes. I hope the types are in scope... (compile untested) Affected files ... .. //depot/projects/hammer/lib/libc/include/libc_private.h#11 edit .. //depot/projects/hammer/lib/libc/sys/ftruncate.c#4 edit .. //depot/projects/hammer/lib/libc/sys/lseek.c#4 edit .. //depot/projects/hammer/lib/libc/sys/mmap.c#5 edit .. //depot/projects/hammer/lib/libc/sys/pread.c#4 edit .. //depot/projects/hammer/lib/libc/sys/pwrite.c#4 edit .. //depot/projects/hammer/lib/libc/sys/truncate.c#4 edit Differences ... ==== //depot/projects/hammer/lib/libc/include/libc_private.h#11 (text+ko) ==== @@ -171,8 +171,15 @@ /* * Get kern.osreldate to detect ABI revisions. Explicitly - * ignores value of $OSVERSION and caches result. + * ignores value of $OSVERSION and caches result. Prototypes + * for the wrapped "new" pad-less syscalls are here for now. */ extern int __getosreldate(void); +extern off_t __new_lseek(int, off_t, int); +extern int __new_ftruncate(int, off_t); +extern int __new_truncate(const char *, off_t); +extern ssize_t __new_pread(int, void *, size_t, off_t); +extern ssize_t __new_pwrite(int, void *, size_t, off_t); +extern void * __new_mmap(void *, size_t, int, int, int, off_t); #endif /* _LIBC_PRIVATE_H_ */ ==== //depot/projects/hammer/lib/libc/sys/ftruncate.c#4 (text+ko) ==== @@ -36,7 +36,7 @@ #include <sys/types.h> #include <sys/syscall.h> #include <unistd.h> -#include <osreldate.h> +#include "libc-private.h" /* * This function provides 64-bit offset padding that @@ -48,7 +48,7 @@ off_t length; { - if (getosreldate() >= 700049) + if (__getosreldate() >= 700049) return(__new_ftruncate(fd, length)); else return(__syscall((quad_t)SYS_ftruncate, fd, 0, length)); ==== //depot/projects/hammer/lib/libc/sys/lseek.c#4 (text+ko) ==== @@ -36,7 +36,7 @@ #include <sys/types.h> #include <sys/syscall.h> #include <unistd.h> -#include <osreldate.h> +#include "libc-private.h" /* * This function provides 64-bit offset padding that @@ -49,7 +49,7 @@ int whence; { - if (getosreldate() >= 700049) + if (__getosreldate() >= 700049) return(__new_lseek(fd, offset, whence)); else return(__syscall((quad_t)SYS_lseek, fd, 0, offset, whence)); ==== //depot/projects/hammer/lib/libc/sys/mmap.c#5 (text+ko) ==== @@ -37,7 +37,7 @@ #include <sys/mman.h> #include <sys/syscall.h> #include <unistd.h> -#include <osreldate.h> +#include "libc-private.h" /* * This function provides 64-bit offset padding that @@ -53,7 +53,7 @@ off_t offset; { - if (getosreldate() >= 700049) + if (__getosreldate() >= 700049) return (__new_mmap(addr, len, prot, flags, fd, offset)); else ==== //depot/projects/hammer/lib/libc/sys/pread.c#4 (text+ko) ==== @@ -36,7 +36,7 @@ #include <sys/types.h> #include <sys/syscall.h> #include <unistd.h> -#include <osreldate.h> +#include "libc-private.h" /* * This function provides 64-bit offset padding that @@ -50,7 +50,7 @@ off_t offset; { - if (getosreldate() >= 700049) + if (__getosreldate() >= 700049) return (__new_pread(fd, buf, nbyte, offset)); else return ((ssize_t)__syscall((quad_t)SYS_pread, fd, buf, nbyte, 0, offset)); ==== //depot/projects/hammer/lib/libc/sys/pwrite.c#4 (text+ko) ==== @@ -36,7 +36,7 @@ #include <sys/types.h> #include <sys/syscall.h> #include <unistd.h> -#include <osreldate.h> +#include "libc-private.h" /* * This function provides 64-bit offset padding that @@ -49,7 +49,7 @@ size_t nbyte; off_t offset; { - if (getosreldate() >= 700049) + if (__getosreldate() >= 700049) return (__new_pwrite(fd, buf, nbyte, offset)); else return ((ssize_t)__syscall((quad_t)SYS_pwrite, fd, buf, nbyte, 0, offset)); ==== //depot/projects/hammer/lib/libc/sys/truncate.c#4 (text+ko) ==== @@ -36,7 +36,7 @@ #include <sys/types.h> #include <sys/syscall.h> #include <unistd.h> -#include <osreldate.h> +#include "libc-private.h" /* * This function provides 64-bit offset padding that @@ -48,7 +48,7 @@ off_t length; { - if (getosreldate() >= 700049) + if (__getosreldate() >= 700049) return(__new_truncate(path, length)); else return(__syscall((quad_t)SYS_truncate, path, 0, length));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706302346.l5UNkEn8012466>