diff options
| author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2020-03-19 11:28:04 +0000 |
|---|---|---|
| committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2020-03-19 11:28:04 +0000 |
| commit | 9f9bdc6d9964c15e63aa7abeb78eff3f478b0cfc (patch) | |
| tree | afc22e4ff8117865a8e7f2ab56a74396fc154f63 /usr/src/lib/libbc/libc/sys/sys5 | |
| parent | bfe191c490dc33e77e134e9bb5e2c8a3da737a29 (diff) | |
| parent | 97b5374547d500fded52d886ceba8a9962af0527 (diff) | |
| download | illumos-joyent-9f9bdc6d9964c15e63aa7abeb78eff3f478b0cfc.tar.gz | |
[illumos-gate merge]
commit 97b5374547d500fded52d886ceba8a9962af0527
12292 retire libbc
Diffstat (limited to 'usr/src/lib/libbc/libc/sys/sys5')
34 files changed, 0 insertions, 1809 deletions
diff --git a/usr/src/lib/libbc/libc/sys/sys5/access.c b/usr/src/lib/libbc/libc/sys/sys5/access.c deleted file mode 100644 index 7354450bd1..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/access.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/syscall.h> -#include <unistd.h> -#include <sys/param.h> - -int -access(char *path, int mode) -{ - return (access_com(path, mode)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/chdir.c b/usr/src/lib/libbc/libc/sys/sys5/chdir.c deleted file mode 100644 index 3bb3ea864a..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/chdir.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 1990 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/syscall.h> - -int -chdir(char *s) -{ - return (_syscall(SYS_chdir, s)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/chmod.c b/usr/src/lib/libbc/libc/sys/sys5/chmod.c deleted file mode 100644 index 32840d46fb..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/chmod.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved. - */ - -#include <sys/syscall.h> -#include <sys/fcntl.h> - -int -chmod(char *s, mode_t m) -{ - return (_syscall(SYS_fchmodat, AT_FDCWD, s, m, 0)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/chown.c b/usr/src/lib/libbc/libc/sys/sys5/chown.c deleted file mode 100644 index 7367a37871..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/chown.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#include <sys/syscall.h> -#include <sys/fcntl.h> - -int -chown(char *s, int u, int g) -{ - return (_syscall(SYS_fchownat, AT_FDCWD, s, u, g, AT_SYMLINK_NOFOLLOW)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/chroot.c b/usr/src/lib/libbc/libc/sys/sys5/chroot.c deleted file mode 100644 index b52aac898c..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/chroot.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 1990 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/syscall.h> - -int -chroot(char *d) -{ - return (_syscall(SYS_chroot, d)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/creat.c b/usr/src/lib/libbc/libc/sys/sys5/creat.c deleted file mode 100644 index 06e3de38ac..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/creat.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 1990 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -int creat(path, mode) -char *path; -int mode; -{ - - return(creat_com(path, mode)); -} - diff --git a/usr/src/lib/libbc/libc/sys/sys5/execve.c b/usr/src/lib/libbc/libc/sys/sys5/execve.c deleted file mode 100644 index 1ade79a2d4..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/execve.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#include <string.h> -#include <sys/file.h> -#include <sys/syscall.h> - -int -execve(char *file, char **argv, char **arge) -{ - char *c; - char path[256]; - - if (strncmp(file, "/usr/bin", strlen("/usr/bin")) == 0 || - strncmp(file, "/bin", strlen("/bin")) == 0) { - if (_syscall(SYS_faccessat, AT_FDCWD, file, F_OK, 0) == -1) { - strcpy(path, "/usr/ucb"); - strcat(path, strrchr(file, '/')); - file = path; - } - } - else if (strncmp(file, "/usr/ucb", strlen("/usr/ucb")) == 0) { - strcpy(path, "/usr/bin"); - strcat(path, strrchr(file, '/')); - if (_syscall(SYS_faccessat, AT_FDCWD, path, F_OK, 0) == 0) - file = path; - } - else if (strncmp(file, "/usr/5bin", strlen("/usr/5bin")) == 0) { - strcpy(path, "/usr/bin"); - strcat(path, strrchr(file, '/')); - if (_syscall(SYS_faccessat, AT_FDCWD, path, F_OK, 0) == 0) - file = path; - else { - strcpy(path, "/usr/ucb"); - strcat(path, strrchr(file, '/')); - if (_syscall(SYS_faccessat, AT_FDCWD, path, F_OK, 0) - == 0) - file = path; - } - } - - return (_syscall(SYS_execve, file, argv, arge)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/fcntl.c b/usr/src/lib/libbc/libc/sys/sys5/fcntl.c deleted file mode 100644 index 3d8342ba4c..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/fcntl.c +++ /dev/null @@ -1,181 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright (c) 1990-1996 by Sun Microsystems, Inc. - * All rights reserved. - */ - -#ident "%Z%%M% %I% %E% SMI" - -#include <sys/syscall.h> -#include <sys/fcntl.h> -#include <sys/errno.h> -#include <sys/filio.h> -#include <sys/ioccom.h> -#include <unistd.h> - -/* The following is an array of fcntl commands. The numbers listed - * below are from SVR4. Array is indexed with SunOS 4.1 numbers to - * obtain the SVR4 numbers. - */ -int cmd_op[14] = {0, 1, 2, 3, 4, 23, 24, 14, 6, 7, 21, 20, -1, 22}; - -/* SVR4/SunOS 5.0 equivalent modes */ -#define N_O_NDELAY 0x04 -#define N_O_SYNC 0x10 -#define N_O_NONBLOCK 0x80 -#define N_O_CREAT 0x100 -#define N_O_TRUNC 0x200 -#define N_O_EXCL 0x400 - -#define S5_FASYNC 0x1000 - -/* from SVR4 stropts.h */ -#define S5_S_RDNORM 0x0040 -#define S5_S_WRNORM 0x0004 -#define S5_S_RDBAND 0x0080 -#define S5_S_BANDURG 0x0200 -#define S5_I_SETSIG (('S'<<8)|011) -#define S5_I_GETSIG (('S'<<8)|012) - -/* Mask corresponding to the bits above in SunOS 4.x */ -#define FLAGS_MASK (O_SYNC|O_NONBLOCK|O_CREAT|O_TRUNC|O_EXCL \ - |O_NDELAY|FASYNC) -#define N_FLAGS_MASK (N_O_NDELAY|N_O_SYNC|N_O_NONBLOCK|N_O_CREAT \ - |N_O_TRUNC|N_O_EXCL|S5_FASYNC) - -struct n_flock { - short l_type; - short l_whence; - long l_start; - long l_len; /* len == 0 means until end of file */ - long l_sysid; - long l_pid; - long pad[4]; /* reserve area */ -} ; - -int fcntl(fd, cmd, arg) -int fd, cmd, arg; -{ - return(bc_fcntl(fd, cmd, arg)); -} - -int bc_fcntl(fd, cmd, arg) -int fd, cmd, arg; -{ - int fds, ret; - struct flock *savarg; - struct n_flock nfl; - extern int errno; - int narg, i; - - if ((cmd == F_SETOWN) || (cmd == F_GETOWN)) { - ret = _s_fcntl(fd, cmd_op[cmd], arg); - if ((ret != -1) || (errno != EINVAL)) - return (ret); - else { - if (cmd == F_GETOWN) { - if (_ioctl(fd, S5_I_GETSIG, &i) < 0) { - if (errno == EINVAL) - i = 0; - else - return (-1); - } - if (i & (S5_S_RDBAND|S5_S_BANDURG| - S5_S_RDNORM|S5_S_WRNORM)) - return (getpid()); - return (0); - } else { /* cmd == F_SETOWN */ - i = S5_S_RDNORM|S5_S_WRNORM|S5_S_RDBAND|S5_S_BANDURG; - return (ioctl(fd, S5_I_SETSIG, i)); - } - } - } - if (cmd == F_SETFL) { - if (arg & FLAGS_MASK) { - narg = arg & ~FLAGS_MASK; - if (arg & FASYNC) - narg |= S5_FASYNC; - if (arg & O_SYNC) - narg |= N_O_SYNC; - if (arg & O_CREAT) - narg |= N_O_CREAT; - if (arg & O_TRUNC) - narg |= N_O_TRUNC; - if (arg & O_EXCL) - narg |= N_O_EXCL; - if (arg & (O_NDELAY)) - narg |= N_O_NDELAY; - if (arg & O_NONBLOCK) - narg |= N_O_NONBLOCK; - arg = narg; - } - } else if (cmd == F_SETLK || cmd == F_SETLKW || cmd == F_GETLK) { - if (arg == 0 || arg == -1) { - errno = EFAULT; - return(-1); - } - savarg = (struct flock *)arg; - arg = (int) &nfl; - nfl.l_type = savarg->l_type; - nfl.l_whence = savarg->l_whence; - nfl.l_start = savarg->l_start; - nfl.l_len = savarg->l_len; - nfl.l_pid = savarg->l_pid; - } - - ret = _s_fcntl(fd, cmd_op[cmd], arg); - - if (ret != -1) { - if (cmd == F_DUPFD) { - if ((fds = fd_get(fd)) != -1) - fd_add(ret, fds); - } else if (cmd == F_GETFL) { - if (ret & N_FLAGS_MASK) { - narg = ret & ~N_FLAGS_MASK; - if (ret & S5_FASYNC) - narg |= FASYNC; - if (ret & N_O_SYNC) - narg |= O_SYNC; - if (ret & N_O_NONBLOCK) - narg |= O_NONBLOCK; - if (ret & N_O_CREAT) - narg |= O_CREAT; - if (ret & N_O_TRUNC) - narg |= O_TRUNC; - if (ret & N_O_EXCL) - narg |= O_EXCL; - if (ret & (N_O_NDELAY)) - narg |= O_NDELAY; - ret = narg; - } - } else if (cmd == F_SETLK || cmd == F_SETLKW || - cmd == F_GETLK) { - savarg->l_type = nfl.l_type; - savarg->l_whence = nfl.l_whence; - savarg->l_start = nfl.l_start; - savarg->l_len = nfl.l_len; - savarg->l_pid = nfl.l_pid; - } - } - return(ret); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/getgroups.c b/usr/src/lib/libbc/libc/sys/sys5/getgroups.c deleted file mode 100644 index 5351a9d504..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/getgroups.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 1990 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * POSIX.1 compatible getgroups() routine - * This is needed while gid_t is not the same size as int (or whatever the - * syscall is using at the time). - */ - -#include <sys/types.h> -#include <sys/param.h> -#include <sys/syscall.h> - -int -getgroups(int gidsetsize, gid_t grouplist[]) -{ - int glist[NGROUPS]; /* getgroups() syscall returns ints */ - int i; /* loop control */ - int rc; /* return code hold area */ - - rc = _syscall(SYS_getgroups, gidsetsize, glist); - if (rc > 0 && gidsetsize != 0) - for (i = 0; i < rc; i++) - grouplist[i] = (gid_t)glist[i]; - return (rc); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/getpgrp.c b/usr/src/lib/libbc/libc/sys/sys5/getpgrp.c deleted file mode 100644 index b1d6508297..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/getpgrp.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 1990 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - getpgrp -- system call emulation for 4.2BSD - - last edit: 01-Jul-1983 D A Gwyn -*/ - -extern int _getpgrp(); - -int -getpgrp() - { - return _getpgrp( 0 ); /* 0 means this process */ - } diff --git a/usr/src/lib/libbc/libc/sys/sys5/link.c b/usr/src/lib/libbc/libc/sys/sys5/link.c deleted file mode 100644 index 85ecd49af3..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/link.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved. - */ - -#include <sys/syscall.h> -#include <sys/fcntl.h> - -int -link(char *a, char *b) -{ - return (_syscall(SYS_linkat, AT_FDCWD, a, AT_FDCWD, b, 0)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/mkdir.c b/usr/src/lib/libbc/libc/sys/sys5/mkdir.c deleted file mode 100644 index 5f0c8106ea..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/mkdir.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved. - */ - -#include <sys/syscall.h> -#include <sys/fcntl.h> - -int -mkdir(char *p, mode_t m) -{ - return (_syscall(SYS_mkdirat, AT_FDCWD, p, m)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/mkfifo.c b/usr/src/lib/libbc/libc/sys/sys5/mkfifo.c deleted file mode 100644 index e5ecd5d999..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/mkfifo.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 1990 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/types.h> -#include <sys/stat.h> - -int -mkfifo(char *path, mode_t mode) -{ - return (mknod(path, S_IFIFO | (mode & (S_IRWXU|S_IRWXG|S_IRWXO)))); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/mknod.c b/usr/src/lib/libbc/libc/sys/sys5/mknod.c deleted file mode 100644 index 4346b9ab05..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/mknod.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 1990 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * If we're asked to make a directory, do a "mkdir" instead, so we meet - * the letter of the SVID (yuk!). - */ - -#include <sys/types.h> -#include <sys/stat.h> -#include <errno.h> - -extern int _mknod(); - -int -mknod(char *path, int mode, int dev) -{ - if ((mode & S_IFMT) == S_IFDIR) - if (geteuid()) { - errno = EPERM; - return(-1); - } else - return (mkdir(path, mode & 07777)); - else - return (_mknod(path, mode, dev)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/mount.c b/usr/src/lib/libbc/libc/sys/sys5/mount.c deleted file mode 100644 index 4a4fd64645..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/mount.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright (c) 1995 Sun Microsystems, Inc. All rights reserved. - */ - -#ident "%Z%%M% %I% %E% SMI" - -#include <errno.h> - -int -mount(spec, dir, rdonly) -char *spec; -char *dir; -int rdonly; -{ - int ret; - - if ((ret = _mount(spec, dir, rdonly)) != 0) { - maperror(errno); - } - return (ret); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/open.c b/usr/src/lib/libbc/libc/sys/sys5/open.c deleted file mode 100644 index 9a5b30d765..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/open.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 1992 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <errno.h> - - -int -open(char *path, int flags, int mode) -{ - return (bc_open(path, flags, mode)); -} - - -int -bc_open(char *path, int flags, int mode) -{ - if ((path == (char*)0) || (path == (char*) -1)) { - errno = EFAULT; - return (-1); - } - return (open_com(path, flags, mode)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/pathconf.c b/usr/src/lib/libbc/libc/sys/sys5/pathconf.c deleted file mode 100644 index f14a00b6ba..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/pathconf.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 1990 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/syscall.h> - -int -pathconf(char *p, int what) -{ - return (_syscall(SYS_pathconf, p, what)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/read.c b/usr/src/lib/libbc/libc/sys/sys5/read.c deleted file mode 100644 index a52f3f3cae..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/read.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include "../common/compat.h" -#include <stdio.h> -#include <sys/types.h> -#include <unistd.h> -#include <sys/syscall.h> - -/* - * If reading from the utmp file, map the data to the SunOS 4.1 - * format on the fly. - */ - -extern void to_utmp(char *, char *, int); - -int -read(int fd, char *buf, int size) -{ - return (bc_read(fd, buf, size)); -} - -int -bc_read(int fd, char *buf, int size) -{ - int ret, off; - char *nbuf; - - if (fd_get(fd) != -1) { /* we're reading utmp (utmpx, really) */ - size = getmodsize(size, sizeof (struct compat_utmp), - sizeof (struct utmpx)); - - if ((nbuf = (void *)malloc(size)) == NULL) { - (void) fprintf(stderr, "read: malloc failed\n"); - exit(-1); - } - - if ((ret = _read(fd, nbuf, size)) == -1) { - free(nbuf); - return (-1); - } - - to_utmp(buf, nbuf, ret); - - ret = getmodsize(ret, sizeof (struct utmpx), - sizeof (struct compat_utmp)); - free(nbuf); - return (ret); - } - - return (_read(fd, buf, size)); -} - -void -to_utmp(char *buf, char *nbuf, int len) -{ - struct compat_utmp *ut; - struct utmpx *utx; - - utx = (struct utmpx *)nbuf; - ut = (struct compat_utmp *)buf; - - while ((char *)utx < (nbuf + len)) { - (void) strncpy(ut->ut_line, utx->ut_line, sizeof (ut->ut_line)); - (void) strncpy(ut->ut_name, utx->ut_user, sizeof (ut->ut_name)); - (void) strncpy(ut->ut_host, utx->ut_host, sizeof (ut->ut_host)); - ut->ut_time = utx->ut_tv.tv_sec; - utx++; - ut++; - } -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/readlink.c b/usr/src/lib/libbc/libc/sys/sys5/readlink.c deleted file mode 100644 index 9007d4065a..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/readlink.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved. - */ - -#include <sys/syscall.h> -#include <sys/fcntl.h> - -int -readlink(char *p, char *b, int s) -{ - return (_syscall(SYS_readlinkat, AT_FDCWD, p, b, s)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/readv.c b/usr/src/lib/libbc/libc/sys/sys5/readv.c deleted file mode 100644 index 67323be984..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/readv.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include "../common/compat.h" -#include <stdio.h> -#include <sys/types.h> -#include <unistd.h> -#include <sys/syscall.h> -#include <sys/uio.h> - -/* - * If reading from the utmp file, map the data to the SunOS 4.1 - * format on the fly. - */ -extern void to_utmp(char *, char *, int); - -int -readv(int fd, struct iovec *iov, int iovcnt) -{ - return (bc_readv(fd, iov, iovcnt)); -} - -int -bc_readv(int fd, struct iovec *iov, int iovcnt) -{ - int ret, off; - int i, size, total = 0; - char *nbuf; - - if (fd_get(fd) != -1) { - for (i = 0; i < iovcnt; i++) { - size = getmodsize(iov[i].iov_len, - sizeof (struct compat_utmp), - sizeof (struct utmpx)); - - if ((nbuf = (void *)malloc(size)) == NULL) { - fprintf(stderr, "readv: malloc failed\n"); - exit(-1); - } - - if ((ret = _read(fd, nbuf, size)) == -1) { - free(nbuf); - return (-1); - } - - to_utmp(iov[i].iov_base, nbuf, ret); - - ret = getmodsize(ret, sizeof (struct utmpx), - sizeof (struct compat_utmp)); - total += ret; - - free(nbuf); - } - return (total); - } - - return (_readv(fd, iov, iovcnt)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/rename.c b/usr/src/lib/libbc/libc/sys/sys5/rename.c deleted file mode 100644 index 4a534c0653..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/rename.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#include <sys/syscall.h> -#include <sys/fcntl.h> - -int -rename(char *path1, char *path2) -{ - char buf2[256]; - - if (strcmp(path1, "/etc/utmp") == 0 || - strcmp(path1, "/var/adm/utmp") == 0) { - path1 = "/var/adm/utmpx"; - strcpy(buf2, path2); - strcat(buf2, "x"); - path2 = buf2; - } else if (strcmp(path1, "/var/adm/wtmp") == 0) { - path1 = "/var/adm/wtmpx"; - strcpy(buf2, path2); - strcat(buf2, "x"); - path2 = buf2; - } - - return (_syscall(SYS_renameat, AT_FDCWD, path1, AT_FDCWD, path2)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/rmdir.c b/usr/src/lib/libbc/libc/sys/sys5/rmdir.c deleted file mode 100644 index 61b12ef42a..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/rmdir.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#include <sys/syscall.h> -#include <sys/fcntl.h> - -int -rmdir(char *d) -{ - - return (_syscall(SYS_unlinkat, AT_FDCWD, d, AT_REMOVEDIR)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/setgid.c b/usr/src/lib/libbc/libc/sys/sys5/setgid.c deleted file mode 100644 index fc3cf277ed..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/setgid.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright (c) 1995, by Sun Microsystems, Inc. - * All rights reserved. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <errno.h> - -int -setgid(int gid) -{ - if (geteuid() == 0) - return (setregid(gid, gid)); - else - return (setregid(-1, gid)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/setgroups.c b/usr/src/lib/libbc/libc/sys/sys5/setgroups.c deleted file mode 100644 index 689d0165bd..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/setgroups.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 1990 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * POSIX.1 compatible setgroups() routine - * This is needed while gid_t is not the same size as int (or whatever the - * syscall is using at the time). - */ - -#include <errno.h> -#include <sys/types.h> -#include <sys/param.h> -#include <sys/syscall.h> - -int -setgroups(int ngroups, gid_t grouplist[]) -{ - int glist[NGROUPS]; /* setgroups() syscall expects ints */ - int i; /* loop control */ - - if (ngroups > NGROUPS) { - errno = EINVAL; - return (-1); - } - for (i = 0; i < ngroups; i++) - glist[i] = (int)grouplist[i]; - return (_syscall(SYS_setgroups, ngroups, glist)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/setjmp.c b/usr/src/lib/libbc/libc/sys/sys5/setjmp.c deleted file mode 100644 index 3227218946..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/setjmp.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* Copyright (c) 1988 AT&T */ -/* All Rights Reserved */ - - -/* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - - -#include <sys/setjmp.h> -#include "../common/ucontext.h" - -int _getsp(); - -int -setjmp(env) - jmp_buf env; -{ - register o_setjmp_struct_t *bp = (o_setjmp_struct_t *)env; - register int sp = _getsp(); - ucontext_t uc; - - /* - * Get the current machine context. - */ - uc.uc_flags = UC_STACK; - __getcontext(&uc); - - /* - * Note that the pc and former sp (fp) from the stack are valid - * because the call to __getcontext must flush the user windows - * to the stack. - */ - bp->sjs_flags = 0; - bp->sjs_sp = *((int *)sp+14); - bp->sjs_pc = *((int *)sp+15) + 0x8; - bp->sjs_sigmask[0] = 0; - bp->sjs_sigmask[1] = 0; - bp->sjs_sigmask[2] = 0; - bp->sjs_stack = uc.uc_stack; - - return (0); -} - - -void -longjmp(env, val) - jmp_buf env; - int val; -{ - o_setjmp_struct_t *bp = (o_setjmp_struct_t *)env; - setjmp_struct_t sjmp, *sp; - - sp = &sjmp; - sp->sjs_flags = bp->sjs_flags; - sp->sjs_sp = bp->sjs_sp; - sp->sjs_pc = bp->sjs_pc; - sp->sjs_fp = 0; - sp->sjs_i7 = 0; - sp->sjs_uclink = 0; - sp->sjs_sigmask[0] = bp->sjs_sigmask[0]; - sp->sjs_sigmask[1] = bp->sjs_sigmask[1]; - sp->sjs_sigmask[2] = bp->sjs_sigmask[2]; - sp->sjs_sigmask[3] = 0; - sp->sjs_stack = bp->sjs_stack; - _siglongjmp(sjmp, val); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/setpgrp.c b/usr/src/lib/libbc/libc/sys/sys5/setpgrp.c deleted file mode 100644 index d1f75e5097..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/setpgrp.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 1990 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -extern int setsid(); - -int -setpgrp() -{ - - return (setsid()); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/setuid.c b/usr/src/lib/libbc/libc/sys/sys5/setuid.c deleted file mode 100644 index c5cfacff9e..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/setuid.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright (c) 1995, by Sun Microsystems, Inc. - * All rights reserved. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -int -setuid(int uid) -{ - if (geteuid() == 0) - return (setreuid(uid, uid)); - else - return (setreuid(-1, uid)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/stat.c b/usr/src/lib/libbc/libc/sys/sys5/stat.c deleted file mode 100644 index 13d0726a41..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/stat.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#include <sys/syscall.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/errno.h> - -extern int errno; - -int stat(path, buf) -char *path; -struct stat *buf; -{ - return(bc_stat(path, buf)); -} - -int bc_stat(path, buf) -char *path; -struct stat *buf; -{ - if (path == (char*)0) { - errno = EFAULT; - return (-1); - } - if ((buf == (struct stat*)0) || (buf == (struct stat*)-1)) { - errno = EFAULT; - return (-1); - } - return(stat_com(0, path, buf)); -} - - -int lstat(path, buf) -char *path; -struct stat *buf; -{ - return(bc_lstat(path, buf)); -} - -int bc_lstat(path, buf) -char *path; -struct stat *buf; -{ - return(stat_com(1, path, buf)); -} - diff --git a/usr/src/lib/libbc/libc/sys/sys5/statfs.c b/usr/src/lib/libbc/libc/sys/sys5/statfs.c deleted file mode 100644 index b2d663c20b..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/statfs.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 1990 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/types.h> -#include <sys/vfs.h> - -int -statfs(char *s, struct statfs *b) -{ - return (statfs_com(s, b)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/symlink.c b/usr/src/lib/libbc/libc/sys/sys5/symlink.c deleted file mode 100644 index cf96a6cbd6..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/symlink.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved. - */ - -#include <sys/syscall.h> -#include <sys/fcntl.h> - -int -symlink(char *t, char *f) -{ - return (_syscall(SYS_symlinkat, t, AT_FDCWD, f)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/truncate.c b/usr/src/lib/libbc/libc/sys/sys5/truncate.c deleted file mode 100644 index b322965d91..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/truncate.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include <sys/syscall.h> -#include <unistd.h> -#include <errno.h> -#include <sys/fcntl.h> -#include <sys/param.h> - -int -truncate(char *path, off_t length) -{ - int fd, ret = 0; - - if (strcmp(path, "/etc/mtab") == 0 || strcmp(path, "/etc/fstab") == 0) { - errno = ENOENT; - return (-1); - } - if ((fd = open(path, O_WRONLY)) == -1) { - return (-1); - } - - if (ftruncate(fd, length) == -1) { - close(fd); - return (-1); - } - close(fd); - return (0); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/unlink.c b/usr/src/lib/libbc/libc/sys/sys5/unlink.c deleted file mode 100644 index 7c30c45f0d..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/unlink.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#include <sys/syscall.h> -#include <sys/fcntl.h> - -int -unlink(const char *path) -{ - if (strcmp(path, "/etc/utmp") == 0 || - strcmp(path, "/var/adm/utmp") == 0) - path = "/var/adm/utmpx"; - else if (strcmp(path, "/var/adm/wtmp") == 0) - path = "/var/adm/wtmpx"; - - return (_syscall(SYS_unlinkat, AT_FDCWD, path, 0)); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/write.c b/usr/src/lib/libbc/libc/sys/sys5/write.c deleted file mode 100644 index d385a23077..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/write.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright (c) 1999 by Sun Microsystems, Inc. - * All rights reserved. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include "../common/compat.h" -#include <stdio.h> -#include <sys/types.h> -#include <unistd.h> - -/* - * If writing to a utmp-like file, map the utmp structure to - * new format on the fly. - */ -extern int conv2utmpx(char *, char *, int); - -int -write(int fd, char *buf, int size) -{ - return (bc_write(fd, buf, size)); -} - -int -bc_write(int fd, char *buf, int size) -{ - int ret, off; - int nsize; - char *nbuf; - - if (fd_get(fd) != -1) { - nsize = getmodsize(size, sizeof (struct compat_utmp), - sizeof (struct utmpx)); - - if ((nbuf = (void *)malloc(nsize)) == NULL) { - (void) fprintf(stderr, "write: malloc failed\n"); - exit(-1); - } - - (void) memset(nbuf, 0, nsize); - - ret = conv2utmpx(nbuf, buf, size); - - if ((ret = _write(fd, nbuf, ret)) == -1) { - free(nbuf); - return (-1); - } - - free(nbuf); - - ret = getmodsize(ret, sizeof (struct utmpx), - sizeof (struct compat_utmp)); - return (ret); - } - - return (_write(fd, buf, size)); -} - -/* From SunOS/SVR4 utmp.h */ -#define USER_PROCESS 7 -#define DEAD_PROCESS 8 - -extern int -conv2utmpx(char *nbuf, char *buf, int len) -{ - struct compat_utmp *ut; - struct utmpx *utx; - - utx = (struct utmpx *) nbuf; - ut = (struct compat_utmp *) buf; - - while ((char *)ut < (buf + len)) { - (void) strcpy(utx->ut_user, ut->ut_name); - (void) memset(utx->ut_id, 0, sizeof (utx->ut_id)); - (void) strcpy(utx->ut_line, ut->ut_line); - utx->ut_pid = 0; - if ((strcmp(utx->ut_user, "") == 0) && - (strcmp(utx->ut_host, "") == 0)) - utx->ut_type = DEAD_PROCESS; - else - utx->ut_type = USER_PROCESS; - utx->ut_exit.e_termination = 0; - utx->ut_exit.e_exit = 0; - utx->ut_tv.tv_sec = ut->ut_time; - utx->ut_tv.tv_usec = 0; - utx->ut_session = 0; - utx->ut_syslen = sizeof (ut->ut_name) + 1; - (void) strcpy(utx->ut_host, ut->ut_host); - ut++; - utx++; - } - return ((char *) utx - nbuf); -} diff --git a/usr/src/lib/libbc/libc/sys/sys5/writev.c b/usr/src/lib/libbc/libc/sys/sys5/writev.c deleted file mode 100644 index a833f4e3a2..0000000000 --- a/usr/src/lib/libbc/libc/sys/sys5/writev.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ - -/* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -#include "../common/compat.h" -#include <stdio.h> -#include <sys/types.h> -#include <unistd.h> -#include <sys/uio.h> - -/* - * If writing to a utmp-like file, map the utmp structure to - * new format on the fly. - */ -extern int conv2utmpx(char *, char *, int); - -int -writev(int fd, struct iovec *iov, int iovcnt) -{ - return (bc_writev(fd, iov, iovcnt)); -} - -int -bc_writev(int fd, struct iovec *iov, int iovcnt) -{ - int ret, off; - int nsize, total = 0; - char *nbuf; - int i; - - if (fd_get(fd) != -1) { - for (i = 0; i < iovcnt; i++) { - nsize = getmodsize(iov[i].iov_len, - sizeof (struct compat_utmp), - sizeof (struct utmpx)); - - if ((nbuf = (void *)malloc(nsize)) == NULL) { - fprintf(stderr, "writev: malloc failed\n"); - exit(-1); - } - - (void) memset(nbuf, 0, nsize); - - ret = conv2utmpx(nbuf, iov[i].iov_base, iov[i].iov_len); - - if ((ret = _write(fd, nbuf, ret)) == -1) { - free(nbuf); - return (-1); - } - - free(nbuf); - - ret = getmodsize(ret, sizeof (struct utmpx), - sizeof (struct compat_utmp)); - total += ret; - } - return (total); - } - - return (_writev(fd, iov, iovcnt)); -} |
