summaryrefslogtreecommitdiffstats
path: root/sys/compat/svr4
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2011-09-16 13:58:51 +0000
committerkmacy <kmacy@FreeBSD.org>2011-09-16 13:58:51 +0000
commit99851f359e6f006b3223bb37dbc49e751ca8c13a (patch)
tree2ed8c1cfa9e408c1c66c2cde0823123897e0306e /sys/compat/svr4
parentbf8fedabcd023c90bb2ee4ce0e5d6d8c2b927714 (diff)
downloadFreeBSD-src-99851f359e6f006b3223bb37dbc49e751ca8c13a.zip
FreeBSD-src-99851f359e6f006b3223bb37dbc49e751ca8c13a.tar.gz
In order to maximize the re-usability of kernel code in user space this
patch modifies makesyscalls.sh to prefix all of the non-compatibility calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel entry points and all places in the code that use them. It also fixes an additional name space collision between the kernel function psignal and the libc function of the same name by renaming the kernel psignal kern_psignal(). By introducing this change now we will ease future MFCs that change syscalls. Reviewed by: rwatson Approved by: re (bz)
Diffstat (limited to 'sys/compat/svr4')
-rw-r--r--sys/compat/svr4/svr4_fcntl.c4
-rw-r--r--sys/compat/svr4/svr4_filio.c2
-rw-r--r--sys/compat/svr4/svr4_ipc.c16
-rw-r--r--sys/compat/svr4/svr4_misc.c20
-rw-r--r--sys/compat/svr4/svr4_signal.c2
-rw-r--r--sys/compat/svr4/svr4_socket.c2
-rw-r--r--sys/compat/svr4/svr4_stat.c2
-rw-r--r--sys/compat/svr4/svr4_stream.c20
8 files changed, 34 insertions, 34 deletions
diff --git a/sys/compat/svr4/svr4_fcntl.c b/sys/compat/svr4/svr4_fcntl.c
index ce1452a..cbca7e2 100644
--- a/sys/compat/svr4/svr4_fcntl.c
+++ b/sys/compat/svr4/svr4_fcntl.c
@@ -368,7 +368,7 @@ fd_truncate(td, fd, flp)
ft.fd = fd;
ft.length = start;
- error = ftruncate(td, &ft);
+ error = sys_ftruncate(td, &ft);
fdrop(fp, td);
return (error);
@@ -476,7 +476,7 @@ svr4_sys_llseek(td, uap)
#endif
ap.whence = uap->whence;
- return lseek(td, &ap);
+ return sys_lseek(td, &ap);
}
int
diff --git a/sys/compat/svr4/svr4_filio.c b/sys/compat/svr4/svr4_filio.c
index cb7cada..967169b 100644
--- a/sys/compat/svr4/svr4_filio.c
+++ b/sys/compat/svr4/svr4_filio.c
@@ -75,7 +75,7 @@ svr4_sys_poll(td, uap)
siz = uap->nfds * sizeof(struct pollfd);
pfd = (struct pollfd *)malloc(siz, M_TEMP, M_WAITOK);
- error = poll(td, (struct poll_args *)uap);
+ error = sys_poll(td, (struct poll_args *)uap);
if ((cerr = copyin(uap->fds, pfd, siz)) != 0) {
error = cerr;
diff --git a/sys/compat/svr4/svr4_ipc.c b/sys/compat/svr4/svr4_ipc.c
index 658c6d6..f816cb0 100644
--- a/sys/compat/svr4/svr4_ipc.c
+++ b/sys/compat/svr4/svr4_ipc.c
@@ -292,7 +292,7 @@ svr4_semget(td, v)
ap.nsems = uap->nsems;
ap.semflg = uap->semflg;
- return semget(td, &ap);
+ return sys_semget(td, &ap);
}
struct svr4_sys_semop_args {
@@ -315,7 +315,7 @@ svr4_semop(td, v)
ap.sops = (struct sembuf *) uap->sops;
ap.nsops = uap->nsops;
- return semop(td, &ap);
+ return sys_semop(td, &ap);
}
int
@@ -400,7 +400,7 @@ svr4_msgsnd(td, v)
ap.msgsz = uap->msgsz;
ap.msgflg = uap->msgflg;
- return msgsnd(td, &ap);
+ return sys_msgsnd(td, &ap);
}
struct svr4_sys_msgrcv_args {
@@ -426,7 +426,7 @@ svr4_msgrcv(td, v)
ap.msgtyp = uap->msgtyp;
ap.msgflg = uap->msgflg;
- return msgrcv(td, &ap);
+ return sys_msgrcv(td, &ap);
}
struct svr4_sys_msgget_args {
@@ -446,7 +446,7 @@ svr4_msgget(td, v)
ap.key = uap->key;
ap.msgflg = uap->msgflg;
- return msgget(td, &ap);
+ return sys_msgget(td, &ap);
}
struct svr4_sys_msgctl_args {
@@ -569,7 +569,7 @@ svr4_shmat(td, v)
ap.shmaddr = uap->shmaddr;
ap.shmflg = uap->shmflg;
- return shmat(td, &ap);
+ return sys_shmat(td, &ap);
}
struct svr4_sys_shmdt_args {
@@ -587,7 +587,7 @@ svr4_shmdt(td, v)
ap.shmaddr = uap->shmaddr;
- return shmdt(td, &ap);
+ return sys_shmdt(td, &ap);
}
struct svr4_sys_shmget_args {
@@ -609,7 +609,7 @@ svr4_shmget(td, v)
ap.size = uap->size;
ap.shmflg = uap->shmflg;
- return shmget(td, &ap);
+ return sys_shmget(td, &ap);
}
struct svr4_sys_shmctl_args {
diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c
index c0a7478..8456e10 100644
--- a/sys/compat/svr4/svr4_misc.c
+++ b/sys/compat/svr4/svr4_misc.c
@@ -569,7 +569,7 @@ svr4_sys_mmap(td, uap)
mm.addr = uap->addr;
mm.pos = uap->pos;
- return mmap(td, &mm);
+ return sys_mmap(td, &mm);
}
int
@@ -602,7 +602,7 @@ svr4_sys_mmap64(td, uap)
mm.addr != 0 && (void *)mm.addr < rp)
mm.addr = rp;
- return mmap(td, &mm);
+ return sys_mmap(td, &mm);
}
@@ -844,7 +844,7 @@ svr4_sys_break(td, uap)
struct obreak_args ap;
ap.nsize = uap->nsize;
- return (obreak(td, &ap));
+ return (sys_obreak(td, &ap));
}
static __inline clock_t
@@ -990,7 +990,7 @@ svr4_sys_pgrpsys(td, uap)
* setsid() for SVR4. (Under BSD, the difference is that
* a setpgid(0,0) will not create a new session.)
*/
- setsid(td, NULL);
+ sys_setsid(td, NULL);
/*FALLTHROUGH*/
case 0: /* getpgrp() */
@@ -1013,7 +1013,7 @@ svr4_sys_pgrpsys(td, uap)
return 0;
case 3: /* setsid() */
- return setsid(td, NULL);
+ return sys_setsid(td, NULL);
case 4: /* getpgid(pid) */
@@ -1032,7 +1032,7 @@ svr4_sys_pgrpsys(td, uap)
sa.pid = uap->pid;
sa.pgid = uap->pgid;
- return setpgid(td, &sa);
+ return sys_setpgid(td, &sa);
}
default:
@@ -1598,7 +1598,7 @@ svr4_sys_memcntl(td, uap)
msa.len = uap->len;
msa.flags = (int)uap->arg;
- return msync(td, &msa);
+ return sys_msync(td, &msa);
}
case SVR4_MC_ADVISE:
{
@@ -1608,7 +1608,7 @@ svr4_sys_memcntl(td, uap)
maa.len = uap->len;
maa.behav = (int)uap->arg;
- return madvise(td, &maa);
+ return sys_madvise(td, &maa);
}
case SVR4_MC_LOCK:
case SVR4_MC_UNLOCK:
@@ -1633,11 +1633,11 @@ svr4_sys_nice(td, uap)
ap.who = 0;
ap.prio = uap->prio;
- if ((error = setpriority(td, &ap)) != 0)
+ if ((error = sys_setpriority(td, &ap)) != 0)
return error;
/* the cast is stupid, but the structures are the same */
- if ((error = getpriority(td, (struct getpriority_args *)&ap)) != 0)
+ if ((error = sys_getpriority(td, (struct getpriority_args *)&ap)) != 0)
return error;
return 0;
diff --git a/sys/compat/svr4/svr4_signal.c b/sys/compat/svr4/svr4_signal.c
index 0034abd..3791c05 100644
--- a/sys/compat/svr4/svr4_signal.c
+++ b/sys/compat/svr4/svr4_signal.c
@@ -519,7 +519,7 @@ svr4_sys_kill(td, uap)
return (EINVAL);
ka.pid = uap->pid;
ka.signum = SVR4_SVR42BSD_SIG(uap->signum);
- return kill(td, &ka);
+ return sys_kill(td, &ka);
}
diff --git a/sys/compat/svr4/svr4_socket.c b/sys/compat/svr4/svr4_socket.c
index 3f3d7c5..038267c 100644
--- a/sys/compat/svr4/svr4_socket.c
+++ b/sys/compat/svr4/svr4_socket.c
@@ -238,5 +238,5 @@ svr4_sys_socket(td, uap)
default:
return EINVAL;
}
- return socket(td, (struct socket_args *)uap);
+ return sys_socket(td, (struct socket_args *)uap);
}
diff --git a/sys/compat/svr4/svr4_stat.c b/sys/compat/svr4/svr4_stat.c
index cc84396..b686642 100644
--- a/sys/compat/svr4/svr4_stat.c
+++ b/sys/compat/svr4/svr4_stat.c
@@ -694,6 +694,6 @@ svr4_sys_fpathconf(td, uap)
*retval = 0;
return 0;
default:
- return fpathconf(td, (struct fpathconf_args *)uap);
+ return sys_fpathconf(td, (struct fpathconf_args *)uap);
}
}
diff --git a/sys/compat/svr4/svr4_stream.c b/sys/compat/svr4/svr4_stream.c
index a1a42c0..27014e3 100644
--- a/sys/compat/svr4/svr4_stream.c
+++ b/sys/compat/svr4/svr4_stream.c
@@ -523,7 +523,7 @@ si_listen(fp, fd, ioc, td)
DPRINTF(("SI_LISTEN: fileno %d backlog = %d\n", fd, 5));
la.backlog = 5;
- if ((error = listen(td, &la)) != 0) {
+ if ((error = sys_listen(td, &la)) != 0) {
DPRINTF(("SI_LISTEN: listen failed %d\n", error));
return error;
}
@@ -637,7 +637,7 @@ si_shutdown(fp, fd, ioc, td)
ap.s = fd;
- return shutdown(td, &ap);
+ return sys_shutdown(td, &ap);
}
@@ -1056,7 +1056,7 @@ i_fdinsert(fp, td, retval, fd, cmd, dat)
d2p.from = st->s_afd;
d2p.to = fdi.fd;
- if ((error = dup2(td, &d2p)) != 0) {
+ if ((error = sys_dup2(td, &d2p)) != 0) {
DPRINTF(("fdinsert: dup2(%d, %d) failed %d\n",
st->s_afd, fdi.fd, error));
mtx_unlock(&Giant);
@@ -1099,7 +1099,7 @@ _i_bind_rsvd(fp, td, retval, fd, cmd, dat)
ap.path = dat;
ap.mode = S_IFIFO;
- return mkfifo(td, &ap);
+ return sys_mkfifo(td, &ap);
}
static int
@@ -1119,7 +1119,7 @@ _i_rele_rsvd(fp, td, retval, fd, cmd, dat)
*/
ap.path = dat;
- return unlink(td, &ap);
+ return sys_unlink(td, &ap);
}
static int
@@ -1539,7 +1539,7 @@ svr4_do_putmsg(td, uap, fp)
wa.fd = uap->fd;
wa.buf = dat.buf;
wa.nbyte = dat.len;
- return write(td, &wa);
+ return sys_write(td, &wa);
}
DPRINTF(("putmsg: Invalid inet length %ld\n", sc.len));
return EINVAL;
@@ -1926,7 +1926,7 @@ svr4_do_getmsg(td, uap, fp)
ra.fd = uap->fd;
ra.buf = dat.buf;
ra.nbyte = dat.maxlen;
- if ((error = read(td, &ra)) != 0) {
+ if ((error = sys_read(td, &ra)) != 0) {
mtx_unlock(&Giant);
return error;
}
@@ -1995,7 +1995,7 @@ int svr4_sys_send(td, uap)
sta.to = NULL;
sta.tolen = 0;
- return (sendto(td, &sta));
+ return (sys_sendto(td, &sta));
}
int svr4_sys_recv(td, uap)
@@ -2011,7 +2011,7 @@ int svr4_sys_recv(td, uap)
rfa.from = NULL;
rfa.fromlenaddr = NULL;
- return (recvfrom(td, &rfa));
+ return (sys_recvfrom(td, &rfa));
}
/*
@@ -2033,6 +2033,6 @@ svr4_sys_sendto(td, uap)
sa.tolen = uap->tolen;
DPRINTF(("calling sendto()\n"));
- return sendto(td, &sa);
+ return sys_sendto(td, &sa);
}
OpenPOWER on IntegriCloud