summaryrefslogtreecommitdiff
path: root/usr/src/lib/libbc/libc
diff options
context:
space:
mode:
authorRichard Lowe <richlowe@richlowe.net>2010-08-19 02:18:39 -0400
committerRichard Lowe <richlowe@richlowe.net>2010-08-19 02:18:39 -0400
commit6a634c9dca3093f3922e4b7ab826d7bdf17bf78e (patch)
treea3cdcd9da4d88203feca3c72607ec2ffddb47ff9 /usr/src/lib/libbc/libc
parent1356956d0b091aa705b3e6330c7224417baa3a89 (diff)
parentdfea898ab532c75e4d1426e0ff2cc5e0d67aa72f (diff)
downloadillumos-joyent-6a634c9dca3093f3922e4b7ab826d7bdf17bf78e.tar.gz
merge with onnv_147
Reviewed by: garrett@nexenta.com Approved by: garrett@nexenta.com
Diffstat (limited to 'usr/src/lib/libbc/libc')
-rw-r--r--usr/src/lib/libbc/libc/gen/common/getacinfo.c310
-rw-r--r--usr/src/lib/libbc/libc/gen/common/getfaudflgs.c86
-rw-r--r--usr/src/lib/libbc/libc/sys/4.2/chmod.c20
-rw-r--r--usr/src/lib/libbc/libc/sys/4.2/link.c18
-rw-r--r--usr/src/lib/libbc/libc/sys/4.2/mkdir.c18
-rw-r--r--usr/src/lib/libbc/libc/sys/4.2/mknod.c16
-rw-r--r--usr/src/lib/libbc/libc/sys/4.2/readlink.c16
-rw-r--r--usr/src/lib/libbc/libc/sys/4.2/symlink.c18
-rw-r--r--usr/src/lib/libbc/libc/sys/common/syscall.c21
-rw-r--r--usr/src/lib/libbc/libc/sys/sys5/chmod.c16
-rw-r--r--usr/src/lib/libbc/libc/sys/sys5/link.c14
-rw-r--r--usr/src/lib/libbc/libc/sys/sys5/mkdir.c16
-rw-r--r--usr/src/lib/libbc/libc/sys/sys5/readlink.c14
-rw-r--r--usr/src/lib/libbc/libc/sys/sys5/symlink.c14
14 files changed, 91 insertions, 506 deletions
diff --git a/usr/src/lib/libbc/libc/gen/common/getacinfo.c b/usr/src/lib/libbc/libc/gen/common/getacinfo.c
deleted file mode 100644
index cf0192ed16..0000000000
--- a/usr/src/lib/libbc/libc/gen/common/getacinfo.c
+++ /dev/null
@@ -1,310 +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 1989 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-/* getacinfo.c - get audit control info */
-
-#include <stdio.h>
-#include <string.h>
-
-#define DIROP 0
-#define OTHEROP 1
-
-#define LEN 360 /* maximum audit control entry length */
-
-#define SUCCESS 0
-#define EOF_WARN 1
-#define REW_WARN 2
-#define EOF_ERR -1
-#define ERROR -2
-#define FORMAT_ERR -3
-
-
-static char *AUDIT_CTRL = "/etc/security/audit/audit_control";
-static char *MINLABEL = "minfree:";
-static char *DIRLABEL = "dir:";
-static char *FLGLABEL = "flags:";
-static int LASTOP;
-static int DIRINIT;
-static FILE *acf; /* pointer into /etc/security/audit/audit_control */
-
-void setac(void);
-void endac(void);
-
-/* getacinfo.c - get audit control info
- *
- * getacdir() - get audit control directories, one at a time
- * getacflg() - get audit control flags
- * getacmin() - get audit control directory min. fill value
- * setac() - rewind the audit control file
- * endac() - close the audit control file
- */
-
-
-/* getacdir() - get audit control directories, one at a time
- *
- * input: len - size of dir buffer
- *
- * output: dir - directory string
- *
- * returns: 0 - entry read ok
- * -1 - end of file
- * -2 - error - can't open audit control file for read
- * -3 - error - directory entry format error
- * 1 - directory search started from beginning again
- *
- * notes: It is the responsibility of the calling function to
- * check the status of the directory entry.
- */
-
-int
-getacdir(char *dir, int len)
-{
- int retstat = SUCCESS, gotone = 0, dirlen, dirst;
- char entry[LEN];
-
- /*
- * open file if it is not already opened
- */
- if (acf == NULL && (acf = fopen(AUDIT_CTRL, "r")) == NULL)
- retstat = ERROR;
- else if (LASTOP != DIROP && DIRINIT == 1) {
- retstat = REW_WARN;
- setac();
- } else {
- DIRINIT = 1;
- LASTOP == DIROP;
- }
- if (retstat >= SUCCESS) {
- do {
- if (fgets(entry, LEN, acf) != NULL) {
- switch(*entry) {
- case '#':
- break;
- case 'd':
- /*
- * return directory entry
- */
- if (!strncmp(entry,DIRLABEL,strlen(DIRLABEL))) {
- if ((strlen(entry)+1) > len)
- retstat = FORMAT_ERR;
- else {
- /*
- * allow zero or one blank
- * between colon and directory
- */
- if (entry[strlen(DIRLABEL)] == ' ') {
- dirst = strlen(DIRLABEL)+1;
- dirlen =
- strlen(entry) -
- (strlen(DIRLABEL)+2);
- } else {
- dirst = strlen(DIRLABEL);
- dirlen =
- strlen(entry) -
- (strlen(DIRLABEL)+1);
- }
- strcpy(dir, entry+dirst);
- strcpy(dir+dirlen, "\0");
- gotone = 1;
- }
- } else
- retstat = FORMAT_ERR;
- break;
- case 'm':
- break;
- case 'f':
- break;
- default:
- break;
- }
- } else if ((feof(acf)) == 0)
- retstat = ERROR;
- else
- retstat = EOF_ERR;
-
- } while (gotone == 0 && retstat >= SUCCESS);
- }
- return (retstat);
-}
-
-/*
- * getacmin() - get audit control directory min. fill value
- *
- * output: min_val - percentage of directory fill allowed
- *
- * returns: 0 - entry read ok
- * 1 - end of file
- * -2 - error; errno contains error number
- * -3 - error - directory entry format error
- */
-
-int
-getacmin(int *min_val)
-{
- int retstat = SUCCESS, gotone = 0;
- char entry[LEN];
-
- /*
- * open file if it is not already opened
- */
- if (acf == NULL && (acf = fopen(AUDIT_CTRL, "r")) == NULL)
- retstat = ERROR;
- else
- rewind(acf);
-
- if (retstat == SUCCESS) {
- do {
- if (fgets(entry, LEN, acf) != NULL) {
- switch(*entry) {
- case '#':
- break;
- case 'd':
- break;
- case 'm':
- if (!strncmp(entry, MINLABEL, strlen(MINLABEL))) {
- sscanf(entry+strlen(MINLABEL), "%d", min_val);
- gotone = 1;
- } else
- retstat = FORMAT_ERR;
- break;
- case 'f':
- break;
- default:
- break;
- }
- } else if ((feof(acf)) == 0)
- retstat = ERROR;
- else
- retstat = EOF_WARN;
-
- } while (gotone == 0 && retstat == SUCCESS);
- }
-
- if (LASTOP == DIROP)
- LASTOP = OTHEROP;
- else
- endac();
-
- return (retstat);
-}
-
-/* getacflg() - get audit control flags
- *
- * output: auditstring - character representation of system audit flags
- *
- * returns: 0 - entry read ok
- * 1 - end of file
- * -2 - error - errno contains error number
- * -3 - error - directory entry format error
- */
-
-int
-getacflg(char *auditstring, int len)
-{
- int retstat = SUCCESS, gotone = 0, minst, minlen;
- char entry[LEN];
-
- /*
- * open file if it is not already opened
- */
- if (acf == NULL && (acf = fopen(AUDIT_CTRL, "r")) == NULL)
- retstat = ERROR;
- else
- rewind(acf);
-
- if (retstat == SUCCESS) {
- do {
- if (fgets(entry, LEN, acf) != NULL) {
- switch(*entry) {
- case '#':
- break;
- case 'd':
- break;
- case 'm':
- break;
- case 'f':
- if ((strncmp(entry, FLGLABEL, strlen(FLGLABEL))) == 0) {
- if (entry[strlen(FLGLABEL)] == ' ') {
- minst = strlen(FLGLABEL)+1;
- minlen = strlen(entry)-(strlen(FLGLABEL)+2);
- } else {
- minst = strlen(FLGLABEL);
- minlen = strlen(entry)-(strlen(FLGLABEL)+1);
- }
- if (minlen > len)
- retstat = FORMAT_ERR;
- else {
- strcpy(auditstring, entry+minst);
- strcpy(auditstring+minlen, "\0");
- gotone = 1;
- }
- } else
- retstat = FORMAT_ERR;
- break;
- default:
- break;
- }
- } else if ((feof(acf)) == 0)
- retstat = ERROR;
- else
- retstat = EOF_WARN;
-
- } while (gotone == 0 && retstat == SUCCESS);
- }
- if (LASTOP == DIROP)
- LASTOP = OTHEROP;
- else
- endac();
-
- return (retstat);
-}
-
-/* rewind the audit control file */
-void
-setac(void)
-{
- if (acf == NULL)
- acf = fopen(AUDIT_CTRL, "r");
- else
- rewind(acf);
- LASTOP = DIROP;
- DIRINIT = 0;
-}
-
-
-/* close the audit control file */
-void
-endac(void)
-{
- if (acf != NULL) {
- fclose(acf);
- acf = NULL;
- }
- LASTOP = DIROP;
- DIRINIT = 0;
-}
diff --git a/usr/src/lib/libbc/libc/gen/common/getfaudflgs.c b/usr/src/lib/libbc/libc/gen/common/getfaudflgs.c
deleted file mode 100644
index 7a17b58af9..0000000000
--- a/usr/src/lib/libbc/libc/gen/common/getfaudflgs.c
+++ /dev/null
@@ -1,86 +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 <sys/types.h>
-#include <sys/label.h>
-#include <sys/audit.h>
-
-#define MAXSTRLEN 360
-
-/* getfaudflgs.c */
-
-/*
- * getfauditflags() - combines system event flag mask with user event
- * flag masks.
- *
- * input: usremasks->as_success - always audit on success
- * usremasks->as_failure - always audit on failure
- * usrdmasks->as_success - never audit on success
- * usrdmasks->as_failure - never audit on failure
- *
- * output: lastmasks->as_success - audit on success
- * lastmasks->as_failure - audit on failure
- *
- * returns: 0 - ok
- * -1 - error
- */
-
-int
-getfauditflags(audit_state_t *usremasks, audit_state_t *usrdmasks,
- audit_state_t *lastmasks)
-{
- int len = MAXSTRLEN, retstat = 0;
- char s_auditstring[MAXSTRLEN];
- audit_state_t masks;
-
- masks.as_success = 0;
- masks.as_failure = 0;
- /*
- * get system audit mask and convert to bit mask
- */
- if ((getacflg(s_auditstring, len)) >= 0) {
- if ((getauditflagsbin(s_auditstring, &masks)) != 0)
- retstat = -1;
- } else
- retstat = -1;
-
- /*
- * combine system and user event masks
- */
- if (retstat == 0) {
- lastmasks->as_success = masks.as_success;
- lastmasks->as_failure = masks.as_failure;
-
- lastmasks->as_success |= usremasks->as_success;
- lastmasks->as_failure |= usremasks->as_failure;
-
- lastmasks->as_success &= ~(usrdmasks->as_success);
- lastmasks->as_failure &= ~(usrdmasks->as_failure);
- }
- return (retstat);
-}
diff --git a/usr/src/lib/libbc/libc/sys/4.2/chmod.c b/usr/src/lib/libbc/libc/sys/4.2/chmod.c
index f5992d7a00..ea98fb387a 100644
--- a/usr/src/lib/libbc/libc/sys/4.2/chmod.c
+++ b/usr/src/lib/libbc/libc/sys/4.2/chmod.c
@@ -2,9 +2,8 @@
* 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.
+ * 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.
@@ -19,18 +18,17 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 1990 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-# include "chkpath.h"
+#include "chkpath.h"
+#include <sys/fcntl.h>
int
-chmod(char *s, int m)
+chmod(char *s, mode_t m)
{
- CHKNULL(s);
- return (_syscall(SYS_chmod, s, m));
+ CHKNULL(s);
+ return (_syscall(SYS_fchmodat, AT_FDCWD, s, m, 0));
}
diff --git a/usr/src/lib/libbc/libc/sys/4.2/link.c b/usr/src/lib/libbc/libc/sys/4.2/link.c
index 8b060e4774..a48eca7975 100644
--- a/usr/src/lib/libbc/libc/sys/4.2/link.c
+++ b/usr/src/lib/libbc/libc/sys/4.2/link.c
@@ -2,9 +2,8 @@
* 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.
+ * 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.
@@ -19,19 +18,18 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 1990 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "chkpath.h"
+#include <sys/fcntl.h>
int
link(char *a, char *b)
{
- CHKNULL(a);
- CHKNULL(b);
- return (_syscall(SYS_link, a, b));
+ CHKNULL(a);
+ CHKNULL(b);
+ return (_syscall(SYS_linkat, AT_FDCWD, a, AT_FDCWD, b, 0));
}
diff --git a/usr/src/lib/libbc/libc/sys/4.2/mkdir.c b/usr/src/lib/libbc/libc/sys/4.2/mkdir.c
index 97925363e1..23bed9c6c0 100644
--- a/usr/src/lib/libbc/libc/sys/4.2/mkdir.c
+++ b/usr/src/lib/libbc/libc/sys/4.2/mkdir.c
@@ -2,9 +2,8 @@
* 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.
+ * 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.
@@ -19,18 +18,17 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 1990 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "chkpath.h"
+#include <sys/fcntl.h>
int
-mkdir(char *p, int m)
+mkdir(char *p, mode_t m)
{
- CHKNULL(p);
- return (_syscall(SYS_mkdir, p, m));
+ CHKNULL(p);
+ return (_syscall(SYS_mkdirat, AT_FDCWD, p, m));
}
diff --git a/usr/src/lib/libbc/libc/sys/4.2/mknod.c b/usr/src/lib/libbc/libc/sys/4.2/mknod.c
index f69c4d6d2c..b06033270d 100644
--- a/usr/src/lib/libbc/libc/sys/4.2/mknod.c
+++ b/usr/src/lib/libbc/libc/sys/4.2/mknod.c
@@ -2,9 +2,8 @@
* 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.
+ * 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.
@@ -19,18 +18,17 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 1990 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "chkpath.h"
+#include <sys/fcntl.h>
int
mknod(char *p, int m, int d)
{
- CHKNULL(p);
- return (_syscall(SYS_mknod, p, m, d));
+ CHKNULL(p);
+ return (_syscall(SYS_mknodat, AT_FDCWD, p, m, d));
}
diff --git a/usr/src/lib/libbc/libc/sys/4.2/readlink.c b/usr/src/lib/libbc/libc/sys/4.2/readlink.c
index ff8f566f23..4c24ef8f75 100644
--- a/usr/src/lib/libbc/libc/sys/4.2/readlink.c
+++ b/usr/src/lib/libbc/libc/sys/4.2/readlink.c
@@ -2,9 +2,8 @@
* 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.
+ * 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.
@@ -19,18 +18,17 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 1990 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "chkpath.h"
+#include <sys/fcntl.h>
int
readlink(char *p, char *b, int s)
{
- CHKNULL(p);
- return (_syscall(SYS_readlink, p, b, s));
+ CHKNULL(p);
+ return (_syscall(SYS_readlinkat, AT_FDCWD, p, b, s));
}
diff --git a/usr/src/lib/libbc/libc/sys/4.2/symlink.c b/usr/src/lib/libbc/libc/sys/4.2/symlink.c
index c9bf39cc17..622832a703 100644
--- a/usr/src/lib/libbc/libc/sys/4.2/symlink.c
+++ b/usr/src/lib/libbc/libc/sys/4.2/symlink.c
@@ -2,9 +2,8 @@
* 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.
+ * 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.
@@ -19,19 +18,18 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 1990 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "chkpath.h"
+#include <sys/fcntl.h>
int
symlink(char *t, char *f)
{
- CHKNULL(t);
- CHKNULL(f);
- return (_syscall(SYS_symlink, t, f));
+ CHKNULL(t);
+ CHKNULL(f);
+ return (_syscall(SYS_symlinkat, t, AT_FDCWD, f));
}
diff --git a/usr/src/lib/libbc/libc/sys/common/syscall.c b/usr/src/lib/libbc/libc/sys/common/syscall.c
index 83079878f8..945143e40e 100644
--- a/usr/src/lib/libbc/libc/sys/common/syscall.c
+++ b/usr/src/lib/libbc/libc/sys/common/syscall.c
@@ -20,8 +20,7 @@
*/
/*
- * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <errno.h>
@@ -37,9 +36,9 @@
int syscallnum[190] = { SYS_syscall, SYS_exit, -1 /*fork1*/,
SYS_read, SYS_write, -1 /*open*/, SYS_close,
- -1, -1 /*creat*/, SYS_link, -1 /*unlink*/,
- -1, SYS_chdir, 0, SYS_mknod,
- SYS_chmod, -1 /*lchown*/, 0, 0,
+ -1, -1 /*creat*/, -1 /*link*/, -1 /*unlink*/,
+ -1, SYS_chdir, 0, -1 /*mknod*/,
+ -1 /*chmod*/, -1 /*lchown*/, 0, 0,
SYS_lseek, SYS_getpid, 0, 0,
0, SYS_getuid, 0, 0,
0, 0, 0, 0,
@@ -49,7 +48,7 @@ int syscallnum[190] = { SYS_syscall, SYS_exit, -1 /*fork1*/,
0, SYS_profil, 0, 0,
SYS_getgid, 0, 0, 0,
SYS_acct, 0, -1, SYS_ioctl,
- -1 /*reboot*/, 0, SYS_symlink, SYS_readlink,
+ -1 /*reboot*/, 0, -1 /*symlink*/, -1 /*readlink*/,
SYS_execve, SYS_umask, SYS_chroot, -1 /*fstat*/,
0, -1/*getpagesize*/,-1, 0,
0, 0, -1, -1,
@@ -66,10 +65,10 @@ int syscallnum[190] = { SYS_syscall, SYS_exit, -1 /*fork1*/,
-1 /*sigpause*/, -1 /*sigstack*/, -1 /*recvmsg*/, -1 /*sendmsg*/,
-1 /*vtrace*/, SYS_gettimeofday, -1 /*getrusage*/, -1 /*getsockopt*/,
0, SYS_readv, SYS_writev, -1 /*settimeofday*/,
- -1 /*fchown*/, SYS_fchmod, -1 /*recvfrom*/, -1 /*setreuid*/,
+ -1 /*fchown*/, -1 /*fchmod*/, -1 /*recvfrom*/, -1 /*setreuid*/,
-1 /*getregid*/, -1 /*rename*/, -1 /*truncate*/, -1 /*ftruncate*/,
-1 /*flock*/, 0, -1 /*sendto*/, -1 /*shutdown*/,
- -1 /*socketpair*/,SYS_mkdir, -1 /*rmdir*/, -1 /*utimes*/,
+ -1 /*socketpair*/, -1 /*mkdir*/, -1 /*rmdir*/, -1 /*utimes*/,
0, SYS_adjtime, -1 /*getpeername*/,-1 /*gethostid*/,
0, SYS_getrlimit, SYS_setrlimit, -1 /*killpg*/,
0, 0, 0, -1/*getsockname*/,
@@ -474,6 +473,11 @@ syscall(int sysnum, ...)
i3 = va_arg(ap, int);
va_end(ap);
return (poll(c1, i2, i3));
+ case XSYS_fchmod:
+ i1 = va_arg(ap, int);
+ i2 = va_arg(ap, int);
+ va_end(ap);
+ return (fchmod(i1, i2));
case XSYS_fchown:
i1 = va_arg(ap, int);
i2 = va_arg(ap, int);
@@ -616,7 +620,6 @@ syscall(int sysnum, ...)
case XSYS_adjtime:
case XSYS_exit:
case XSYS_fchdir:
- case XSYS_fchmod:
case XSYS_fchroot:
case XSYS_getgid:
case XSYS_getitimer:
diff --git a/usr/src/lib/libbc/libc/sys/sys5/chmod.c b/usr/src/lib/libbc/libc/sys/sys5/chmod.c
index 0116dc7aab..32840d46fb 100644
--- a/usr/src/lib/libbc/libc/sys/sys5/chmod.c
+++ b/usr/src/lib/libbc/libc/sys/sys5/chmod.c
@@ -2,9 +2,8 @@
* 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.
+ * 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.
@@ -19,17 +18,16 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 1990 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/syscall.h>
+#include <sys/fcntl.h>
int
-chmod(char *s, int m)
+chmod(char *s, mode_t m)
{
- return (_syscall(SYS_chmod, s, m));
+ return (_syscall(SYS_fchmodat, AT_FDCWD, s, m, 0));
}
diff --git a/usr/src/lib/libbc/libc/sys/sys5/link.c b/usr/src/lib/libbc/libc/sys/sys5/link.c
index 5025510281..85ecd49af3 100644
--- a/usr/src/lib/libbc/libc/sys/sys5/link.c
+++ b/usr/src/lib/libbc/libc/sys/sys5/link.c
@@ -2,9 +2,8 @@
* 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.
+ * 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.
@@ -19,17 +18,16 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 1990 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/syscall.h>
+#include <sys/fcntl.h>
int
link(char *a, char *b)
{
- return (_syscall(SYS_link, a, 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
index 87fa580398..5f0c8106ea 100644
--- a/usr/src/lib/libbc/libc/sys/sys5/mkdir.c
+++ b/usr/src/lib/libbc/libc/sys/sys5/mkdir.c
@@ -2,9 +2,8 @@
* 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.
+ * 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.
@@ -19,17 +18,16 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 1990 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/syscall.h>
+#include <sys/fcntl.h>
int
-mkdir(char *p, int m)
+mkdir(char *p, mode_t m)
{
- return (_syscall(SYS_mkdir, p, m));
+ return (_syscall(SYS_mkdirat, AT_FDCWD, p, m));
}
diff --git a/usr/src/lib/libbc/libc/sys/sys5/readlink.c b/usr/src/lib/libbc/libc/sys/sys5/readlink.c
index 48e3a692be..9007d4065a 100644
--- a/usr/src/lib/libbc/libc/sys/sys5/readlink.c
+++ b/usr/src/lib/libbc/libc/sys/sys5/readlink.c
@@ -2,9 +2,8 @@
* 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.
+ * 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.
@@ -19,17 +18,16 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 1990 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/syscall.h>
+#include <sys/fcntl.h>
int
readlink(char *p, char *b, int s)
{
- return (_syscall(SYS_readlink, p, b, s));
+ return (_syscall(SYS_readlinkat, AT_FDCWD, p, b, s));
}
diff --git a/usr/src/lib/libbc/libc/sys/sys5/symlink.c b/usr/src/lib/libbc/libc/sys/sys5/symlink.c
index 666b3b44e2..cf96a6cbd6 100644
--- a/usr/src/lib/libbc/libc/sys/sys5/symlink.c
+++ b/usr/src/lib/libbc/libc/sys/sys5/symlink.c
@@ -2,9 +2,8 @@
* 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.
+ * 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.
@@ -19,17 +18,16 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 1990 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/syscall.h>
+#include <sys/fcntl.h>
int
symlink(char *t, char *f)
{
- return (_syscall(SYS_symlink, t, f));
+ return (_syscall(SYS_symlinkat, t, AT_FDCWD, f));
}