From f7ed99378fdffd6370ae656244285fa5b7ffe64f Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Tue, 13 Jun 2006 08:17:42 +0000 Subject: [PATCH] The pread/preadv/pwrite/pwritev system calls have been renamed. Create wrappers in libc for the renamed functions. --- Makefile.inc1 | 4 ++-- lib/libc/i386/sys/Makefile.inc | 4 ++-- lib/libc/sys/Makefile.inc | 5 +++-- lib/libc/sys/pread.c | 10 ++++++---- lib/libc/sys/{pwrite.c => preadv.c} | 13 ++++++++----- lib/libc/sys/pwrite.c | 10 ++++++---- lib/libc/sys/{pwrite.c => pwritev.c} | 13 ++++++++----- 7 files changed, 35 insertions(+), 24 deletions(-) copy lib/libc/sys/{pwrite.c => preadv.c} (83%) copy lib/libc/sys/{pwrite.c => pwritev.c} (83%) diff --git a/Makefile.inc1 b/Makefile.inc1 index 22d93d73e6..6a927f1ff8 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1,6 +1,6 @@ # # $FreeBSD: src/Makefile.inc1,v 1.141.2.62 2003/04/06 19:54:00 dwmalone Exp $ -# $DragonFly: src/Makefile.inc1,v 1.84 2005/10/11 13:31:05 corecode Exp $ +# $DragonFly: src/Makefile.inc1,v 1.85 2006/06/13 08:17:35 dillon Exp $ # # Build-time options are documented in make.conf(5). # @@ -394,7 +394,7 @@ installcheck: @pw groupshow _pflogd || (echo "You may need to run 'make preupgrade' first"; exit 1) @pw groupshow _ntp || (echo "You may need to run 'make preupgrade' first"; exit 1) .if !defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/" - @case `uname -r` in 1.2*|1.3-*|1.3.0-*|1.3.1-*|1.3.2-*|1.3.3-*|1.3.4-*) echo "You must upgrade your kernel to at least 1.3.5 and reboot before you can safely installworld, due to stat(2) and dirent ABI changes" ; exit 1;; esac + @case `uname -r` in 1.2*|1.3-*|1.3.*|1.4.*|1.5.0-*|1.5.1-*|1.5.2-*|1.5.3-*) echo "You must upgrade your kernel to at least 1.5.4 and reboot before you can safely installworld, due to libc/system call ABI changes" ; exit 1;; esac .endif # distributeworld diff --git a/lib/libc/i386/sys/Makefile.inc b/lib/libc/i386/sys/Makefile.inc index e2d15337ac..f6fa025665 100644 --- a/lib/libc/i386/sys/Makefile.inc +++ b/lib/libc/i386/sys/Makefile.inc @@ -1,6 +1,6 @@ # from: Makefile.inc,v 1.1 1993/09/03 19:04:23 jtc Exp # $FreeBSD: src/lib/libc/i386/sys/Makefile.inc,v 1.17.2.3 2002/10/15 19:46:46 fjoe Exp $ -# $DragonFly: src/lib/libc/i386/sys/Makefile.inc,v 1.4 2005/05/02 16:23:37 joerg Exp $ +# $DragonFly: src/lib/libc/i386/sys/Makefile.inc,v 1.5 2006/06/13 08:17:39 dillon Exp $ SRCS+= i386_clr_watch.c i386_get_ioperm.c i386_get_ldt.c i386_set_ioperm.c \ i386_set_ldt.c i386_set_watch.c i386_vm86.c @@ -11,7 +11,7 @@ MDASM= Ovfork.S brk.S cerror.S exect.S fork.S pipe.S ptrace.S reboot.S \ # Don't generate default code for these syscalls: NOASM= __semctl.o break.o exit.o ftruncate.o getdomainname.o getlogin.o \ lseek.o mlockall.o mmap.o msgctl.o msgget.o msgrcv.o msgsnd.o \ - munlockall.o openbsd_poll.o pread.o pwrite.o semconfig.o semget.o \ + munlockall.o openbsd_poll.o semconfig.o semget.o \ semop.o setdomainname.o shmat.o shmctl.o shmdt.o shmget.o sstk.o \ thr_sleep.o thr_wakeup.o truncate.o uname.o vfork.o yield.o diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 7437afd992..bce42b2960 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -1,6 +1,6 @@ # @(#)Makefile.inc 8.3 (Berkeley) 10/24/94 # $FreeBSD: src/lib/libc/sys/Makefile.inc,v 1.75.2.7 2003/04/22 17:31:18 trhodes Exp $ -# $DragonFly: src/lib/libc/sys/Makefile.inc,v 1.18 2006/04/27 15:36:00 swildner Exp $ +# $DragonFly: src/lib/libc/sys/Makefile.inc,v 1.19 2006/06/13 08:17:42 dillon Exp $ # sys sources .PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/sys ${.CURDIR}/../libc/sys @@ -17,7 +17,8 @@ .include "${.CURDIR}/../libc/${MACHINE_ARCH}/sys/Makefile.inc" # Sources common to both syscall interfaces: -SRCS+= ftruncate.c lseek.c mmap.c pread.c pwrite.c truncate.c +SRCS+= ftruncate.c lseek.c mmap.c truncate.c +SRCS+= pread.c pwrite.c preadv.c pwritev.c SRCS+= __cvtstatvfs.c fstatvfs.c statvfs.c # Add machine dependent asm sources: diff --git a/lib/libc/sys/pread.c b/lib/libc/sys/pread.c index 0e5deabce8..47ceaab43d 100644 --- a/lib/libc/sys/pread.c +++ b/lib/libc/sys/pread.c @@ -31,19 +31,21 @@ * SUCH DAMAGE. * * @(#)mmap.c 8.1 (Berkeley) 6/17/93 - * $DragonFly: src/lib/libc/sys/pread.c,v 1.3 2005/11/20 13:24:36 swildner Exp $ + * $DragonFly: src/lib/libc/sys/pread.c,v 1.4 2006/06/13 08:17:42 dillon Exp $ */ #include #include #include +ssize_t __pread(int, void *, size_t, int, off_t); + /* - * This function provides 64-bit offset padding that - * is not supplied by GCC 1.X but is supplied by GCC 2.X. + * The kernel __pread includes a flags argument that allows the blocking + * and append mode(s) to be overridden. */ ssize_t pread(int fd, void *buf, size_t nbyte, off_t offset) { - return ((ssize_t)__syscall((quad_t)SYS_pread, fd, buf, nbyte, 0, offset)); + return (__pread(fd, buf, nbyte, 0, offset)); } diff --git a/lib/libc/sys/pwrite.c b/lib/libc/sys/preadv.c similarity index 83% copy from lib/libc/sys/pwrite.c copy to lib/libc/sys/preadv.c index b38b3abd49..06f4b7bcc2 100644 --- a/lib/libc/sys/pwrite.c +++ b/lib/libc/sys/preadv.c @@ -31,19 +31,22 @@ * SUCH DAMAGE. * * @(#)mmap.c 8.1 (Berkeley) 6/17/93 - * $DragonFly: src/lib/libc/sys/pwrite.c,v 1.3 2005/11/20 13:24:36 swildner Exp $ + * $DragonFly: src/lib/libc/sys/preadv.c,v 1.1 2006/06/13 08:17:42 dillon Exp $ */ #include #include +#include #include +ssize_t __preadv(int, const struct iovec *, u_int, int, off_t); + /* - * This function provides 64-bit offset padding that - * is not supplied by GCC 1.X but is supplied by GCC 2.X. + * The kernel __preadv includes a flags argument that allows the blocking + * and append mode(s) to be overridden. */ ssize_t -pwrite(int fd, const void *buf, size_t nbyte, off_t offset) +preadv(int fd, const struct iovec *iovp, int iovcnt, off_t offset) { - return ((ssize_t)__syscall((quad_t)SYS_pwrite, fd, buf, nbyte, 0, offset)); + return (__preadv(fd, iovp, iovcnt, 0, offset)); } diff --git a/lib/libc/sys/pwrite.c b/lib/libc/sys/pwrite.c index b38b3abd49..dffbefc7bd 100644 --- a/lib/libc/sys/pwrite.c +++ b/lib/libc/sys/pwrite.c @@ -31,19 +31,21 @@ * SUCH DAMAGE. * * @(#)mmap.c 8.1 (Berkeley) 6/17/93 - * $DragonFly: src/lib/libc/sys/pwrite.c,v 1.3 2005/11/20 13:24:36 swildner Exp $ + * $DragonFly: src/lib/libc/sys/pwrite.c,v 1.4 2006/06/13 08:17:42 dillon Exp $ */ #include #include #include +ssize_t __pwrite(int, const void *, size_t, int, off_t); + /* - * This function provides 64-bit offset padding that - * is not supplied by GCC 1.X but is supplied by GCC 2.X. + * The kernel __pwrite includes a flags argument that allows the blocking + * and append mode(s) to be overridden. */ ssize_t pwrite(int fd, const void *buf, size_t nbyte, off_t offset) { - return ((ssize_t)__syscall((quad_t)SYS_pwrite, fd, buf, nbyte, 0, offset)); + return (__pwrite(fd, buf, nbyte, 0, offset)); } diff --git a/lib/libc/sys/pwrite.c b/lib/libc/sys/pwritev.c similarity index 83% copy from lib/libc/sys/pwrite.c copy to lib/libc/sys/pwritev.c index b38b3abd49..674198c405 100644 --- a/lib/libc/sys/pwrite.c +++ b/lib/libc/sys/pwritev.c @@ -31,19 +31,22 @@ * SUCH DAMAGE. * * @(#)mmap.c 8.1 (Berkeley) 6/17/93 - * $DragonFly: src/lib/libc/sys/pwrite.c,v 1.3 2005/11/20 13:24:36 swildner Exp $ + * $DragonFly: src/lib/libc/sys/pwritev.c,v 1.1 2006/06/13 08:17:42 dillon Exp $ */ #include #include +#include #include +ssize_t __pwritev(int, const struct iovec *, u_int, int, off_t); + /* - * This function provides 64-bit offset padding that - * is not supplied by GCC 1.X but is supplied by GCC 2.X. + * The kernel __pwritev includes a flags argument that allows the blocking + * and append mode(s) to be overridden. */ ssize_t -pwrite(int fd, const void *buf, size_t nbyte, off_t offset) +pwritev(int fd, const struct iovec *iovp, int iovcnt, off_t offset) { - return ((ssize_t)__syscall((quad_t)SYS_pwrite, fd, buf, nbyte, 0, offset)); + return (__pwritev(fd, iovp, iovcnt, 0, offset)); } -- 2.41.0