diff --git a/lib/libc/Makefile b/lib/libc/Makefile index aa6a737002c4..674986a7e065 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -122,8 +122,7 @@ NOASM= .include "${LIBC_SRCTOP}/stdlib/Makefile.inc" .include "${LIBC_SRCTOP}/stdtime/Makefile.inc" .include "${LIBC_SRCTOP}/string/Makefile.inc" -SHARED_CFLAGS+= -D'_SYSCALL_BODY(name)=' -.include "${LIBSYS_SRCTOP}/Makefile.sys" +.include "${LIBC_SRCTOP}/sys/Makefile.inc" .include "${LIBC_SRCTOP}/secure/Makefile.inc" .include "${LIBC_SRCTOP}/rpc/Makefile.inc" .include "${LIBC_SRCTOP}/uuid/Makefile.inc" diff --git a/lib/libc/amd64/Symbol.map b/lib/libc/amd64/Symbol.map index 2fc723102f90..36f54de24fbd 100644 --- a/lib/libc/amd64/Symbol.map +++ b/lib/libc/amd64/Symbol.map @@ -6,6 +6,7 @@ FBSD_1.0 { .mcount; __flt_rounds; + brk; fpgetmask; fpgetprec; fpgetround; @@ -13,6 +14,7 @@ FBSD_1.0 { fpsetmask; fpsetprec; fpsetround; + sbrk; }; /* @@ -26,4 +28,5 @@ FBSDprivate_1.0 { __signalcontext; signalcontext; __siglongjmp; + _brk; }; diff --git a/lib/libc/arm/Symbol.map b/lib/libc/arm/Symbol.map index ac5a7184b2a1..d8a62c367514 100644 --- a/lib/libc/arm/Symbol.map +++ b/lib/libc/arm/Symbol.map @@ -6,6 +6,8 @@ FBSD_1.0 { __mcount; alloca; + brk; + sbrk; }; FBSD_1.3 { @@ -23,6 +25,7 @@ FBSD_1.6 { }; FBSDprivate_1.0 { + _brk; __aeabi_read_tp; ___longjmp; __longjmp; diff --git a/lib/libc/i386/Symbol.map b/lib/libc/i386/Symbol.map index 2278db54c583..d7961009417e 100644 --- a/lib/libc/i386/Symbol.map +++ b/lib/libc/i386/Symbol.map @@ -5,8 +5,10 @@ */ FBSD_1.0 { .mcount; + brk; __flt_rounds; ___tls_get_addr; + sbrk; }; FBSDprivate_1.0 { @@ -15,4 +17,5 @@ FBSDprivate_1.0 { __signalcontext; signalcontext; __siglongjmp; + _brk; }; diff --git a/lib/libc/powerpc/Symbol.map b/lib/libc/powerpc/Symbol.map index 0996b79369f3..f836a08ae0d4 100644 --- a/lib/libc/powerpc/Symbol.map +++ b/lib/libc/powerpc/Symbol.map @@ -6,11 +6,13 @@ FBSD_1.0 { _mcount; __flt_rounds; + brk; fpgetmask; fpgetround; fpgetsticky; fpsetmask; fpsetround; + sbrk; }; FBSD_1.3 { diff --git a/lib/libc/powerpc64/Symbol.map b/lib/libc/powerpc64/Symbol.map index edccb69e960b..62f20e7f352c 100644 --- a/lib/libc/powerpc64/Symbol.map +++ b/lib/libc/powerpc64/Symbol.map @@ -6,9 +6,11 @@ FBSD_1.0 { _mcount; __flt_rounds; + brk; fpgetmask; fpgetround; fpgetsticky; fpsetmask; fpsetround; + sbrk; }; diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc new file mode 100644 index 000000000000..ee761ce5ff55 --- /dev/null +++ b/lib/libc/sys/Makefile.inc @@ -0,0 +1,38 @@ +# libc-specific portion of the system call interface + +.PATH: ${LIBC_SRCTOP}/sys + +# Most of the implementation is shared with libsys: +.include "${LIBSYS_SRCTOP}/Makefile.sys" + +# emit empty assembly stubs for syscalls in dynamic libc +SHARED_CFLAGS+= -D'_SYSCALL_BODY(name)=' + +SYM_MAPS+= ${LIBC_SRCTOP}/sys/Symbol.map + +# Add the interposer wrappers +SRCS+= ${INTERPOSED:S/$/.c/} + +# Pseudo system calls implemented atop other interfaces. +SRCS+= \ + POSIX2x_Fork.c \ + brk.c \ + closefrom.c \ + compat-stub.c \ + creat.c \ + getdents.c \ + lockf.c \ + lstat.c \ + mknod.c \ + pipe.c \ + recv.c \ + recvmmsg.c \ + send.c \ + sendmmsg.c \ + shm_open.c \ + stat.c \ + vadvise.c \ + wait.c \ + wait3.c \ + waitid.c \ + waitpid.c diff --git a/lib/libsys/POSIX2x_Fork.c b/lib/libc/sys/POSIX2x_Fork.c similarity index 100% rename from lib/libsys/POSIX2x_Fork.c rename to lib/libc/sys/POSIX2x_Fork.c diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map new file mode 100644 index 000000000000..32b1b0ecee05 --- /dev/null +++ b/lib/libc/sys/Symbol.map @@ -0,0 +1,73 @@ +FBSD_1.0 { + accept; + aio_suspend; + close; + connect; + fcntl; + fork; + fsync; + msync; + nanosleep; + open; + pipe; + poll; + pselect; + ptrace; + read; + readv; + recvfrom; + recvmsg; + select; + sendmsg; + sendto; + shm_open; + sigaction; + sigprocmask; + sigsuspend; + sigtimedwait; + sigwait; + sigwaitinfo; + vadvise; + wait4; + write; + writev; +}; + +FBSD_1.1 { + closefrom; +}; + +FBSD_1.2 { + pdfork; +}; + +FBSD_1.3 { + accept4; + wait6; +}; + +FBSD_1.4 { + ppoll; + numa_setaffinity; + numa_getaffinity; + sendmmsg; + recvmmsg; +}; + +FBSD_1.5 { + clock_nanosleep; + fdatasync; + getdents; + kevent; + lstat; + mknod; + stat; +}; + +FBSD_1.6 { + shm_create_largepage; +}; + +FBSD_1.7 { + _Fork; +}; diff --git a/lib/libsys/accept.c b/lib/libc/sys/accept.c similarity index 100% rename from lib/libsys/accept.c rename to lib/libc/sys/accept.c diff --git a/lib/libsys/accept4.c b/lib/libc/sys/accept4.c similarity index 100% rename from lib/libsys/accept4.c rename to lib/libc/sys/accept4.c diff --git a/lib/libsys/aio_suspend.c b/lib/libc/sys/aio_suspend.c similarity index 100% rename from lib/libsys/aio_suspend.c rename to lib/libc/sys/aio_suspend.c diff --git a/lib/libsys/brk.c b/lib/libc/sys/brk.c similarity index 100% rename from lib/libsys/brk.c rename to lib/libc/sys/brk.c diff --git a/lib/libsys/clock_nanosleep.c b/lib/libc/sys/clock_nanosleep.c similarity index 100% rename from lib/libsys/clock_nanosleep.c rename to lib/libc/sys/clock_nanosleep.c diff --git a/lib/libsys/close.c b/lib/libc/sys/close.c similarity index 100% rename from lib/libsys/close.c rename to lib/libc/sys/close.c diff --git a/lib/libsys/closefrom.c b/lib/libc/sys/closefrom.c similarity index 100% rename from lib/libsys/closefrom.c rename to lib/libc/sys/closefrom.c diff --git a/lib/libsys/compat-stub.c b/lib/libc/sys/compat-stub.c similarity index 100% rename from lib/libsys/compat-stub.c rename to lib/libc/sys/compat-stub.c diff --git a/lib/libsys/connect.c b/lib/libc/sys/connect.c similarity index 100% rename from lib/libsys/connect.c rename to lib/libc/sys/connect.c diff --git a/lib/libsys/creat.c b/lib/libc/sys/creat.c similarity index 100% rename from lib/libsys/creat.c rename to lib/libc/sys/creat.c diff --git a/lib/libsys/fcntl.c b/lib/libc/sys/fcntl.c similarity index 100% rename from lib/libsys/fcntl.c rename to lib/libc/sys/fcntl.c diff --git a/lib/libsys/fdatasync.c b/lib/libc/sys/fdatasync.c similarity index 100% rename from lib/libsys/fdatasync.c rename to lib/libc/sys/fdatasync.c diff --git a/lib/libsys/fork.c b/lib/libc/sys/fork.c similarity index 100% rename from lib/libsys/fork.c rename to lib/libc/sys/fork.c diff --git a/lib/libsys/fsync.c b/lib/libc/sys/fsync.c similarity index 100% rename from lib/libsys/fsync.c rename to lib/libc/sys/fsync.c diff --git a/lib/libsys/getdents.c b/lib/libc/sys/getdents.c similarity index 100% rename from lib/libsys/getdents.c rename to lib/libc/sys/getdents.c diff --git a/lib/libsys/kevent.c b/lib/libc/sys/kevent.c similarity index 100% rename from lib/libsys/kevent.c rename to lib/libc/sys/kevent.c diff --git a/lib/libsys/lockf.c b/lib/libc/sys/lockf.c similarity index 100% rename from lib/libsys/lockf.c rename to lib/libc/sys/lockf.c diff --git a/lib/libsys/lstat.c b/lib/libc/sys/lstat.c similarity index 100% rename from lib/libsys/lstat.c rename to lib/libc/sys/lstat.c diff --git a/lib/libsys/mknod.c b/lib/libc/sys/mknod.c similarity index 100% rename from lib/libsys/mknod.c rename to lib/libc/sys/mknod.c diff --git a/lib/libsys/msync.c b/lib/libc/sys/msync.c similarity index 100% rename from lib/libsys/msync.c rename to lib/libc/sys/msync.c diff --git a/lib/libsys/nanosleep.c b/lib/libc/sys/nanosleep.c similarity index 100% rename from lib/libsys/nanosleep.c rename to lib/libc/sys/nanosleep.c diff --git a/lib/libsys/open.c b/lib/libc/sys/open.c similarity index 100% rename from lib/libsys/open.c rename to lib/libc/sys/open.c diff --git a/lib/libsys/openat.c b/lib/libc/sys/openat.c similarity index 100% rename from lib/libsys/openat.c rename to lib/libc/sys/openat.c diff --git a/lib/libsys/pdfork.c b/lib/libc/sys/pdfork.c similarity index 100% rename from lib/libsys/pdfork.c rename to lib/libc/sys/pdfork.c diff --git a/lib/libsys/pipe.c b/lib/libc/sys/pipe.c similarity index 100% rename from lib/libsys/pipe.c rename to lib/libc/sys/pipe.c diff --git a/lib/libsys/poll.c b/lib/libc/sys/poll.c similarity index 100% rename from lib/libsys/poll.c rename to lib/libc/sys/poll.c diff --git a/lib/libsys/ppoll.c b/lib/libc/sys/ppoll.c similarity index 100% rename from lib/libsys/ppoll.c rename to lib/libc/sys/ppoll.c diff --git a/lib/libsys/pselect.c b/lib/libc/sys/pselect.c similarity index 100% rename from lib/libsys/pselect.c rename to lib/libc/sys/pselect.c diff --git a/lib/libsys/read.c b/lib/libc/sys/read.c similarity index 100% rename from lib/libsys/read.c rename to lib/libc/sys/read.c diff --git a/lib/libsys/readv.c b/lib/libc/sys/readv.c similarity index 100% rename from lib/libsys/readv.c rename to lib/libc/sys/readv.c diff --git a/lib/libsys/recv.c b/lib/libc/sys/recv.c similarity index 100% rename from lib/libsys/recv.c rename to lib/libc/sys/recv.c diff --git a/lib/libsys/recvfrom.c b/lib/libc/sys/recvfrom.c similarity index 100% rename from lib/libsys/recvfrom.c rename to lib/libc/sys/recvfrom.c diff --git a/lib/libsys/recvmsg.c b/lib/libc/sys/recvmsg.c similarity index 100% rename from lib/libsys/recvmsg.c rename to lib/libc/sys/recvmsg.c diff --git a/lib/libsys/select.c b/lib/libc/sys/select.c similarity index 100% rename from lib/libsys/select.c rename to lib/libc/sys/select.c diff --git a/lib/libsys/send.c b/lib/libc/sys/send.c similarity index 100% rename from lib/libsys/send.c rename to lib/libc/sys/send.c diff --git a/lib/libsys/sendmsg.c b/lib/libc/sys/sendmsg.c similarity index 100% rename from lib/libsys/sendmsg.c rename to lib/libc/sys/sendmsg.c diff --git a/lib/libsys/sendto.c b/lib/libc/sys/sendto.c similarity index 100% rename from lib/libsys/sendto.c rename to lib/libc/sys/sendto.c diff --git a/lib/libsys/setcontext.c b/lib/libc/sys/setcontext.c similarity index 100% rename from lib/libsys/setcontext.c rename to lib/libc/sys/setcontext.c diff --git a/lib/libsys/shm_open.c b/lib/libc/sys/shm_open.c similarity index 100% rename from lib/libsys/shm_open.c rename to lib/libc/sys/shm_open.c diff --git a/lib/libsys/sigaction.c b/lib/libc/sys/sigaction.c similarity index 100% rename from lib/libsys/sigaction.c rename to lib/libc/sys/sigaction.c diff --git a/lib/libsys/sigprocmask.c b/lib/libc/sys/sigprocmask.c similarity index 100% rename from lib/libsys/sigprocmask.c rename to lib/libc/sys/sigprocmask.c diff --git a/lib/libsys/sigsuspend.c b/lib/libc/sys/sigsuspend.c similarity index 100% rename from lib/libsys/sigsuspend.c rename to lib/libc/sys/sigsuspend.c diff --git a/lib/libsys/sigtimedwait.c b/lib/libc/sys/sigtimedwait.c similarity index 100% rename from lib/libsys/sigtimedwait.c rename to lib/libc/sys/sigtimedwait.c diff --git a/lib/libsys/sigwait.c b/lib/libc/sys/sigwait.c similarity index 100% rename from lib/libsys/sigwait.c rename to lib/libc/sys/sigwait.c diff --git a/lib/libsys/sigwaitinfo.c b/lib/libc/sys/sigwaitinfo.c similarity index 100% rename from lib/libsys/sigwaitinfo.c rename to lib/libc/sys/sigwaitinfo.c diff --git a/lib/libsys/stat.c b/lib/libc/sys/stat.c similarity index 100% rename from lib/libsys/stat.c rename to lib/libc/sys/stat.c diff --git a/lib/libsys/swapcontext.c b/lib/libc/sys/swapcontext.c similarity index 100% rename from lib/libsys/swapcontext.c rename to lib/libc/sys/swapcontext.c diff --git a/lib/libsys/vadvise.c b/lib/libc/sys/vadvise.c similarity index 100% rename from lib/libsys/vadvise.c rename to lib/libc/sys/vadvise.c diff --git a/lib/libsys/wait.c b/lib/libc/sys/wait.c similarity index 100% rename from lib/libsys/wait.c rename to lib/libc/sys/wait.c diff --git a/lib/libsys/wait3.c b/lib/libc/sys/wait3.c similarity index 100% rename from lib/libsys/wait3.c rename to lib/libc/sys/wait3.c diff --git a/lib/libsys/wait4.c b/lib/libc/sys/wait4.c similarity index 100% rename from lib/libsys/wait4.c rename to lib/libc/sys/wait4.c diff --git a/lib/libsys/wait6.c b/lib/libc/sys/wait6.c similarity index 100% rename from lib/libsys/wait6.c rename to lib/libc/sys/wait6.c diff --git a/lib/libsys/waitid.c b/lib/libc/sys/waitid.c similarity index 100% rename from lib/libsys/waitid.c rename to lib/libc/sys/waitid.c diff --git a/lib/libsys/waitpid.c b/lib/libc/sys/waitpid.c similarity index 100% rename from lib/libsys/waitpid.c rename to lib/libc/sys/waitpid.c diff --git a/lib/libsys/write.c b/lib/libc/sys/write.c similarity index 100% rename from lib/libsys/write.c rename to lib/libc/sys/write.c diff --git a/lib/libsys/writev.c b/lib/libc/sys/writev.c similarity index 100% rename from lib/libsys/writev.c rename to lib/libc/sys/writev.c diff --git a/lib/libsys/Makefile.sys b/lib/libsys/Makefile.sys index e798a94e4ae0..98a9688e58a1 100644 --- a/lib/libsys/Makefile.sys +++ b/lib/libsys/Makefile.sys @@ -40,21 +40,6 @@ SRCS+= \ interposing_table.c \ libsys_sigwait.c -SRCS+= getdents.c lstat.c mknod.c stat.c - -SRCS+= creat.c -SRCS+= lockf.c wait.c wait3.c waitpid.c waitid.c -SRCS+= recv.c recvmmsg.c send.c sendmmsg.c - -SRCS+= brk.c -SRCS+= closefrom.c -SRCS+= pipe.c -SRCS+= shm_open.c -SRCS+= vadvise.c -SRCS+= POSIX2x_Fork.c - -SRCS+= compat-stub.c - .if ${LIB} == "c" # Trapping stubs in dynamic libc to be filtered by libsys. SOBJS+= libc_stubs.pico @@ -113,7 +98,6 @@ INTERPOSED = \ write \ writev -SRCS+= ${INTERPOSED:S/$/.c/} PSEUDO+= ${INTERPOSED} # Add machine dependent asm sources: diff --git a/lib/libsys/Symbol.sys.map b/lib/libsys/Symbol.sys.map index fa27dc95aea4..8d68d23686a8 100644 --- a/lib/libsys/Symbol.sys.map +++ b/lib/libsys/Symbol.sys.map @@ -33,7 +33,6 @@ FBSD_1.0 { _exit; _umtx_op; abort2; - accept; access; acct; adjtime; @@ -42,7 +41,6 @@ FBSD_1.0 { aio_fsync; aio_read; aio_return; - aio_suspend; aio_waitcomplete; aio_write; audit; @@ -57,8 +55,6 @@ FBSD_1.0 { clock_getres; clock_gettime; clock_settime; - close; - connect; dup; dup2; eaccess; @@ -81,12 +77,9 @@ FBSD_1.0 { fchflags; fchmod; fchown; - fcntl; fhopen; flock; - fork; fpathconf; - fsync; futimes; getaudit; getaudit_addr; @@ -173,32 +166,21 @@ FBSD_1.0 { msgrcv; msgsnd; msgsys; - msync; munlock; munlockall; munmap; - nanosleep; nfssvc; nmount; ntp_adjtime; ntp_gettime; - open; pathconf; - pipe; - poll; posix_openpt; preadv; profil; - pselect; - ptrace; pwritev; quotactl; - read; readlink; - readv; reboot; - recvfrom; - recvmsg; rename; revoke; rfork; @@ -213,13 +195,10 @@ FBSD_1.0 { sched_setparam; sched_setscheduler; sched_yield; - select; semget; semop; semsys; sendfile; - sendmsg; - sendto; setaudit; setaudit_addr; setauid; @@ -240,23 +219,16 @@ FBSD_1.0 { setsockopt; settimeofday; setuid; - shm_open; shm_unlink; shmat; shmdt; shmget; shmsys; shutdown; - sigaction; sigaltstack; sigpending; - sigprocmask; sigqueue; sigreturn; - sigsuspend; - sigtimedwait; - sigwait; - sigwaitinfo; socket; socketpair; swapon; @@ -285,11 +257,7 @@ FBSD_1.0 { utimes; utrace; uuidgen; - vadvise; vfork; - wait4; - write; - writev; __error; ftruncate; @@ -302,7 +270,6 @@ FBSD_1.0 { FBSD_1.1 { __semctl; - closefrom; cpuset; cpuset_getid; cpuset_setid; @@ -334,7 +301,6 @@ FBSD_1.2 { cap_getmode; getloginclass; getpagesizes; - pdfork; pdgetpid; pdkill; posix_fallocate; @@ -347,7 +313,6 @@ FBSD_1.2 { }; FBSD_1.3 { - accept4; aio_mlock; bindat; cap_fcntls_get; @@ -365,37 +330,24 @@ FBSD_1.3 { pipe2; posix_fadvise; procctl; - wait6; }; FBSD_1.4 { futimens; - ppoll; utimensat; - numa_setaffinity; - numa_getaffinity; - sendmmsg; - recvmmsg; }; FBSD_1.5 { - clock_nanosleep; elf_aux_info; - fdatasync; fhstat; fhstatfs; fstat; fstatat; fstatfs; - getdents; getdirentries; getfsstat; getrandom; - kevent; - lstat; - mknod; mknodat; - stat; statfs; cpuset_getdomain; cpuset_setdomain; @@ -412,12 +364,10 @@ FBSD_1.6 { fhreadlink; getfhat; funlinkat; - shm_create_largepage; shm_rename; }; FBSD_1.7 { - _Fork; fspacectl; kqueuex; membarrier; diff --git a/lib/libsys/amd64/Symbol.sys.map b/lib/libsys/amd64/Symbol.sys.map index 5e0714aef35d..5f463c85f872 100644 --- a/lib/libsys/amd64/Symbol.sys.map +++ b/lib/libsys/amd64/Symbol.sys.map @@ -4,8 +4,6 @@ FBSD_1.0 { amd64_get_gsbase; amd64_set_fsbase; amd64_set_gsbase; - brk; - sbrk; }; FBSD_1.6 { @@ -15,12 +13,6 @@ FBSD_1.6 { x86_pkru_unprotect_range; }; -/* - * - * FreeBSD private ABI - * - */ FBSDprivate_1.0 { - _brk; _vfork; }; diff --git a/lib/libsys/arm/Symbol.sys.map b/lib/libsys/arm/Symbol.sys.map index 179889b60832..a9445ae7ba23 100644 --- a/lib/libsys/arm/Symbol.sys.map +++ b/lib/libsys/arm/Symbol.sys.map @@ -1,10 +1,3 @@ -FBSD_1.0 { - brk; - sbrk; -}; - FBSDprivate_1.0 { _vfork; - _brk; - _sbrk; }; diff --git a/lib/libsys/i386/Symbol.sys.map b/lib/libsys/i386/Symbol.sys.map index 7d8c4ef61c11..303804935435 100644 --- a/lib/libsys/i386/Symbol.sys.map +++ b/lib/libsys/i386/Symbol.sys.map @@ -1,6 +1,5 @@ FBSD_1.0 { rfork_thread; - brk; i386_clr_watch; i386_get_fsbase; i386_get_gsbase; @@ -12,7 +11,6 @@ FBSD_1.0 { i386_set_ldt; i386_set_watch; i386_vm86; - sbrk; }; FBSD_1.6 { @@ -24,5 +22,4 @@ FBSD_1.6 { FBSDprivate_1.0 { _vfork; - _brk; }; diff --git a/lib/libsys/powerpc/Symbol.sys.map b/lib/libsys/powerpc/Symbol.sys.map deleted file mode 100644 index f241c4ed0984..000000000000 --- a/lib/libsys/powerpc/Symbol.sys.map +++ /dev/null @@ -1,4 +0,0 @@ -FBSD_1.0 { - brk; - sbrk; -}; diff --git a/lib/libsys/powerpc64/Symbol.sys.map b/lib/libsys/powerpc64/Symbol.sys.map deleted file mode 100644 index f241c4ed0984..000000000000 --- a/lib/libsys/powerpc64/Symbol.sys.map +++ /dev/null @@ -1,4 +0,0 @@ -FBSD_1.0 { - brk; - sbrk; -};