summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2000-02-05 18:42:36 +0000
committerjoe <joe@FreeBSD.org>2000-02-05 18:42:36 +0000
commitb57f9be4b788fc9ec1fdcfb1979d076f6dfb6be6 (patch)
tree5948d533f1f00d26c5add7b73cba4ee62f634a1b
parent3f518216d3568e20b83d41ad700ea49f6fb54223 (diff)
downloadFreeBSD-src-b57f9be4b788fc9ec1fdcfb1979d076f6dfb6be6.zip
FreeBSD-src-b57f9be4b788fc9ec1fdcfb1979d076f6dfb6be6.tar.gz
Revert part of the last commit, remove {g|s}etflags from the libc
interface, and statically link them to the programs using them. These functions, upon reflection and discussion, are too generically named for a library interface with such specific functionality. Also the api that they use, whilst ok for private use, isn't good enough for a libc function. Additionally there were complications with the build/install-world process. It depends heavily upon xinstall, which got broken by the change in api, and caused bootstrap problems and general mayhem. There is work in progress to address future problems that may be caused by changes in install-chain tools, and better names for {g|s}etflags can be derived when some future program requires them. For now the code has been left in src/lib/libc/gen (it started off in src/bin/ls). It's important to provide library functions for manipulating file flag strings if we ever want this interface to be adopted outside of the source tree, but now isn't necessarily the right moment with 4.0-release just around the corner. Approved: jkh
-rw-r--r--bin/chflags/Makefile2
-rw-r--r--bin/chflags/chflags.c2
-rw-r--r--bin/ls/Makefile3
-rw-r--r--bin/ls/ls.c2
-rw-r--r--bin/rm/Makefile2
-rw-r--r--bin/rm/rm.c2
-rw-r--r--include/unistd.h2
-rw-r--r--lib/libc/gen/Makefile.inc6
-rw-r--r--libexec/ftpd/Makefile4
-rw-r--r--usr.bin/chflags/Makefile2
-rw-r--r--usr.bin/chflags/chflags.c2
-rw-r--r--usr.bin/find/Makefile3
-rw-r--r--usr.bin/find/function.c2
-rw-r--r--usr.bin/xinstall/Makefile2
-rw-r--r--usr.sbin/mtree/Makefile4
15 files changed, 28 insertions, 12 deletions
diff --git a/bin/chflags/Makefile b/bin/chflags/Makefile
index 30b6699..b545bfa 100644
--- a/bin/chflags/Makefile
+++ b/bin/chflags/Makefile
@@ -5,5 +5,7 @@ NOSHARED?=yes
PROG= chflags
CFLAGS+=-Wall
+.PATH: ${.CURDIR}/../../lib/libc/gen
+SRCS= chflags.c setflags.c
.include <bsd.prog.mk>
diff --git a/bin/chflags/chflags.c b/bin/chflags/chflags.c
index daeab4d..784243e 100644
--- a/bin/chflags/chflags.c
+++ b/bin/chflags/chflags.c
@@ -56,6 +56,8 @@ static const char rcsid[] =
#include <string.h>
#include <unistd.h>
+extern u_long setflags __P((char **, u_long *, u_long *));
+
void usage __P((void));
int
diff --git a/bin/ls/Makefile b/bin/ls/Makefile
index 1ab70dc..8496dd9 100644
--- a/bin/ls/Makefile
+++ b/bin/ls/Makefile
@@ -3,6 +3,7 @@
PROG= ls
-SRCS= cmp.c ls.c print.c util.c
+SRCS= cmp.c setflags.c ls.c print.c util.c
+.PATH: ${.CURDIR}/../../lib/libc/gen
.include <bsd.prog.mk>
diff --git a/bin/ls/ls.c b/bin/ls/ls.c
index 5db9997..754236b 100644
--- a/bin/ls/ls.c
+++ b/bin/ls/ls.c
@@ -74,6 +74,8 @@ static const char rcsid[] =
*/
#define STRBUF_SIZEOF(t) (1 + CHAR_BIT * sizeof(t) / 3 + 1)
+char *getflags __P((u_long, char *));
+
static void display __P((FTSENT *, FTSENT *));
static u_quad_t makenines __P((u_long));
static int mastercmp __P((const FTSENT **, const FTSENT **));
diff --git a/bin/rm/Makefile b/bin/rm/Makefile
index 7058fa0..2bbcdf8 100644
--- a/bin/rm/Makefile
+++ b/bin/rm/Makefile
@@ -2,8 +2,10 @@
# $FreeBSD$
PROG= rm
+SRCS= rm.c setflags.c
LINKS= ${BINDIR}/rm ${BINDIR}/unlink
MLINKS= rm.1 unlink.1
+.PATH: ${.CURDIR}/../../lib/libc/gen
.include <bsd.prog.mk>
diff --git a/bin/rm/rm.c b/bin/rm/rm.c
index 4315f99..3c9071f 100644
--- a/bin/rm/rm.c
+++ b/bin/rm/rm.c
@@ -61,6 +61,8 @@ static const char rcsid[] =
#include <sysexits.h>
#include <unistd.h>
+char *getflags __P((u_long, char *));
+
int dflag, eval, fflag, iflag, Pflag, vflag, Wflag, stdin_ok;
uid_t uid;
diff --git a/include/unistd.h b/include/unistd.h
index 6aaefdb..f4deeb5 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -134,7 +134,6 @@ int ftruncate __P((int, off_t));
#endif
int getdomainname __P((char *, int));
int getdtablesize __P((void));
-char *getflags __P((u_long, char *));
int getgrouplist __P((const char *, int, int *, int *));
long gethostid __P((void));
int gethostname __P((char *, int));
@@ -182,7 +181,6 @@ int select __P((int, fd_set *, fd_set *, fd_set *, struct timeval *));
int setdomainname __P((const char *, int));
int setegid __P((gid_t));
int seteuid __P((uid_t));
-int setflags __P((char **, u_long *, u_long *));
int setgroups __P((int, const gid_t *));
void sethostid __P((long));
int sethostname __P((const char *, int));
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
index 7ab2689..2722265 100644
--- a/lib/libc/gen/Makefile.inc
+++ b/lib/libc/gen/Makefile.inc
@@ -20,7 +20,7 @@ SRCS+= _rand48.c _spinlock_stub.c alarm.c arc4random.c assert.c \
nlist.c nrand48.c ntp_gettime.c opendir.c \
pause.c popen.c psignal.c pwcache.c raise.c readdir.c rewinddir.c \
scandir.c seed48.c seekdir.c semconfig.c semctl.c semget.c semop.c \
- setdomainname.c setflags.c sethostname.c setjmperr.c setmode.c shmat.c \
+ setdomainname.c sethostname.c setjmperr.c setmode.c shmat.c \
shmctl.c shmdt.c shmget.c siginterrupt.c siglist.c signal.c \
sigsetops.c sleep.c srand48.c stringlist.c \
sysconf.c sysctl.c sysctlbyname.c \
@@ -45,8 +45,7 @@ MAN3+= alarm.3 arc4random.3 clock.3 \
glob.3 initgroups.3 isinf.3 \
ldexp.3 lockf.3 modf.3 msgctl.3 msgget.3 msgrcv.3 msgsnd.3 \
nice.3 nlist.3 pause.3 popen.3 psignal.3 pwcache.3 \
- raise.3 rand48.3 scandir.3 setflags.3 \
- setjmp.3 setmode.3 siginterrupt.3 \
+ raise.3 rand48.3 scandir.3 setjmp.3 setmode.3 siginterrupt.3 \
signal.3 sigsetops.3 sleep.3 stringlist.3 \
sysconf.3 sysctl.3 syslog.3 tcgetpgrp.3 \
tcsendbreak.3 tcsetattr.3 tcsetpgrp.3 time.3 times.3 timezone.3 \
@@ -101,7 +100,6 @@ MLINKS+=rand48.3 _rand48.3 rand48.3 drand48.3 rand48.3 erand48.3 \
rand48.3 mrand48.3 rand48.3 nrand48.3 rand48.3 seed48.3 \
rand48.3 srand48.3
MLINKS+=scandir.3 alphasort.3
-MLINKS+=setflags.3 getflags.3
MLINKS+=setjmp.3 _longjmp.3 setjmp.3 _setjmp.3 setjmp.3 longjmp.3 \
setjmp.3 longjmperr.3 setjmp.3 longjmperror.3 \
setjmp.3 siglongjmp.3 setjmp.3 sigsetjmp.3
diff --git a/libexec/ftpd/Makefile b/libexec/ftpd/Makefile
index 6b09510..0be34d7 100644
--- a/libexec/ftpd/Makefile
+++ b/libexec/ftpd/Makefile
@@ -14,8 +14,8 @@ LDADD= -lskey -lmd -lcrypt -lutil
DPADD= ${LIBSKEY} ${LIBMD} ${LIBCRYPT} ${LIBUTIL}
LSDIR= ../../bin/ls
-.PATH: ${.CURDIR}/${LSDIR}
-SRCS+= ls.c cmp.c print.c util.c
+.PATH: ${.CURDIR}/${LSDIR} ${.CURDIR}/../../lib/libc/gen
+SRCS+= ls.c cmp.c print.c setflags.c util.c
CFLAGS+=-DINTERNAL_LS -Dmain=ls_main -I${.CURDIR}/${LSDIR}
.if defined(NOPAM)
diff --git a/usr.bin/chflags/Makefile b/usr.bin/chflags/Makefile
index 30b6699..b545bfa 100644
--- a/usr.bin/chflags/Makefile
+++ b/usr.bin/chflags/Makefile
@@ -5,5 +5,7 @@ NOSHARED?=yes
PROG= chflags
CFLAGS+=-Wall
+.PATH: ${.CURDIR}/../../lib/libc/gen
+SRCS= chflags.c setflags.c
.include <bsd.prog.mk>
diff --git a/usr.bin/chflags/chflags.c b/usr.bin/chflags/chflags.c
index daeab4d..784243e 100644
--- a/usr.bin/chflags/chflags.c
+++ b/usr.bin/chflags/chflags.c
@@ -56,6 +56,8 @@ static const char rcsid[] =
#include <string.h>
#include <unistd.h>
+extern u_long setflags __P((char **, u_long *, u_long *));
+
void usage __P((void));
int
diff --git a/usr.bin/find/Makefile b/usr.bin/find/Makefile
index 1d962b9..0b7db36 100644
--- a/usr.bin/find/Makefile
+++ b/usr.bin/find/Makefile
@@ -2,6 +2,7 @@
# $FreeBSD$
PROG= find
-SRCS= find.c function.c ls.c main.c misc.c operator.c option.c
+SRCS= find.c function.c ls.c main.c misc.c operator.c option.c setflags.c
+.PATH: ${.CURDIR}/../../lib/libc/gen
.include <bsd.prog.mk>
diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c
index 7033bde..0dad26b 100644
--- a/usr.bin/find/function.c
+++ b/usr.bin/find/function.c
@@ -71,6 +71,8 @@ static char rcsid[] = "$FreeBSD$";
} \
}
+u_long setflags __P((char **, u_long *, u_long *));
+
static PLAN *palloc __P((enum ntype, int (*) __P((PLAN *, FTSENT *))));
/*
diff --git a/usr.bin/xinstall/Makefile b/usr.bin/xinstall/Makefile
index 2c5dc9f..c8bd6e3 100644
--- a/usr.bin/xinstall/Makefile
+++ b/usr.bin/xinstall/Makefile
@@ -2,6 +2,8 @@
# $FreeBSD$
PROG= xinstall
+SRCS= setflags.c xinstall.c
+.PATH: ${.CURDIR}/../../lib/libc/gen
MAN1= install.1
install: maninstall
diff --git a/usr.sbin/mtree/Makefile b/usr.sbin/mtree/Makefile
index 6a5d615..4e65079 100644
--- a/usr.sbin/mtree/Makefile
+++ b/usr.sbin/mtree/Makefile
@@ -2,9 +2,9 @@
# $FreeBSD$
PROG= mtree
-SRCS= compare.c crc.c create.c misc.c mtree.c spec.c verify.c
+SRCS= compare.c crc.c create.c misc.c mtree.c spec.c verify.c setflags.c
MAN8= mtree.8
-.PATH: ${.CURDIR}/../../usr.bin/cksum
+.PATH: ${.CURDIR}/../../usr.bin/cksum ${.CURDIR}/../../lib/libc/gen
.if !defined(WORLD)
DPADD+= ${LIBMD}
OpenPOWER on IntegriCloud