diff options
author | peter <peter@FreeBSD.org> | 1996-01-01 08:27:41 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1996-01-01 08:27:41 +0000 |
commit | 42bbbd28614c699542553f24fb84264a5130e8e7 (patch) | |
tree | aac25102c388712f99b4b8c8c49d800d87028e5a /lib | |
parent | caa7284440e2e3d7c0e61a6365754b0094120761 (diff) | |
download | FreeBSD-src-42bbbd28614c699542553f24fb84264a5130e8e7.zip FreeBSD-src-42bbbd28614c699542553f24fb84264a5130e8e7.tar.gz |
Bump libutil revision after recent addition of setproctitle().
Install (optional) libutil.h with prototypes for the functions and
document this in the man page.
minor cleanups to the various routines, include the prototype file, declare
return codes etc.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/gen/setproctitle.3 | 10 | ||||
-rw-r--r-- | lib/libutil/Makefile | 8 | ||||
-rw-r--r-- | lib/libutil/libutil.h | 44 | ||||
-rw-r--r-- | lib/libutil/login.c | 1 | ||||
-rw-r--r-- | lib/libutil/login_tty.c | 5 | ||||
-rw-r--r-- | lib/libutil/logout.c | 1 | ||||
-rw-r--r-- | lib/libutil/logwtmp.c | 2 | ||||
-rw-r--r-- | lib/libutil/pty.c | 2 | ||||
-rw-r--r-- | lib/libutil/setproctitle.3 | 10 |
9 files changed, 80 insertions, 3 deletions
diff --git a/lib/libc/gen/setproctitle.3 b/lib/libc/gen/setproctitle.3 index dffed30..5eefe60 100644 --- a/lib/libc/gen/setproctitle.3 +++ b/lib/libc/gen/setproctitle.3 @@ -17,7 +17,7 @@ .\" 5. Modifications may be freely made to this file providing the above .\" conditions are met. .\" -.\" $Id$ +.\" $Id: setproctitle.3,v 1.1 1995/12/26 22:50:08 peter Exp $ .\" .\" The following requests are required for all man pages. .Dd December 16, 1995 @@ -28,8 +28,16 @@ .Nd set the process title for .Xr ps 1 .Sh SYNOPSIS +#include <libutil.h> +.Pp .Ft void .Fn setproctitle "const char *fmt" "..." +.Pp +Link with +.Va -lutil +on the +.Xr cc 1 +command line. .Sh DESCRIPTION The .Nm setproctitle diff --git a/lib/libutil/Makefile b/lib/libutil/Makefile index 47366cc..0ad1151 100644 --- a/lib/libutil/Makefile +++ b/lib/libutil/Makefile @@ -1,8 +1,14 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 LIB= util -CFLAGS+=-DLIBC_SCCS -I/sys +SHLIB_MAJOR= 2 +SHLIB_MINOR= 1 +CFLAGS+=-DLIBC_SCCS -I${.CURDIR} -I/sys SRCS= login.c login_tty.c logout.c logwtmp.c pty.c setproctitle.c MAN3+= setproctitle.3 +beforeinstall: + ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/libutil.h \ + ${DESTDIR}/usr/include + .include <bsd.lib.mk> diff --git a/lib/libutil/libutil.h b/lib/libutil/libutil.h new file mode 100644 index 0000000..3f32d7a --- /dev/null +++ b/lib/libutil/libutil.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 1995 Peter Wemm <peter@freebsd.org> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, is permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice immediately at the beginning of the file, without modification, + * this list of conditions, and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. This work was done expressly for inclusion into FreeBSD. Other use + * is permitted provided this notation is included. + * 4. Absolutely no warranty of function or purpose is made by the author + * Peter Wemm. + * 5. Modifications may be freely made to this file providing the above + * conditions are met. + * + * $Id$ + */ + +#ifndef _LIBUTIL_H_ +#define _LIBUTIL_H_ + +#include <sys/cdefs.h> + +/* Avoid pulling in all the include files for no need */ +struct termios; +struct winsize; +struct utmp; + +__BEGIN_DECLS +void setproctitle __P((const char *fmt, ...)); +void login __P((struct utmp *ut)); +int login_tty __P((int fd)); +int logout __P((char *line)); +void logwtmp __P((char *line, char *name, char *host)); +int openpty __P((int *amaster, int *aslave, char *name, + struct termios *termp, struct winsize *winp)); +__END_DECLS + +#endif /* !_LIBUTIL_H_ */ diff --git a/lib/libutil/login.c b/lib/libutil/login.c index 911c289..3e68563 100644 --- a/lib/libutil/login.c +++ b/lib/libutil/login.c @@ -42,6 +42,7 @@ static char sccsid[] = "@(#)login.c 8.1 (Berkeley) 6/4/93"; #include <stdlib.h> #include <utmp.h> #include <stdio.h> +#include <libutil.h> void login(ut) diff --git a/lib/libutil/login_tty.c b/lib/libutil/login_tty.c index 5692637..a5b19ba 100644 --- a/lib/libutil/login_tty.c +++ b/lib/libutil/login_tty.c @@ -38,6 +38,11 @@ static char sccsid[] = "@(#)login_tty.c 8.1 (Berkeley) 6/4/93"; #include <sys/param.h> #include <sys/ioctl.h> +#include <unistd.h> +#include <stdlib.h> +#include <libutil.h> + +int login_tty(fd) int fd; { diff --git a/lib/libutil/logout.c b/lib/libutil/logout.c index 11da24f..d8cf3c8 100644 --- a/lib/libutil/logout.c +++ b/lib/libutil/logout.c @@ -43,6 +43,7 @@ static char sccsid[] = "@(#)logout.c 8.1 (Berkeley) 6/4/93"; #include <unistd.h> #include <stdlib.h> #include <string.h> +#include <libutil.h> typedef struct utmp UTMP; diff --git a/lib/libutil/logwtmp.c b/lib/libutil/logwtmp.c index d55ac9e..f4a6408 100644 --- a/lib/libutil/logwtmp.c +++ b/lib/libutil/logwtmp.c @@ -42,7 +42,9 @@ static char sccsid[] = "@(#)logwtmp.c 8.1 (Berkeley) 6/4/93"; #include <unistd.h> #include <utmp.h> +#include <libutil.h> +void logwtmp(line, name, host) char *line, *name, *host; { diff --git a/lib/libutil/pty.c b/lib/libutil/pty.c index 5aecbfb..515ff9e 100644 --- a/lib/libutil/pty.c +++ b/lib/libutil/pty.c @@ -47,7 +47,9 @@ static char sccsid[] = "@(#)pty.c 8.3 (Berkeley) 5/16/94"; #include <string.h> #include <termios.h> #include <unistd.h> +#include <libutil.h> +int openpty(amaster, aslave, name, termp, winp) int *amaster, *aslave; char *name; diff --git a/lib/libutil/setproctitle.3 b/lib/libutil/setproctitle.3 index dffed30..5eefe60 100644 --- a/lib/libutil/setproctitle.3 +++ b/lib/libutil/setproctitle.3 @@ -17,7 +17,7 @@ .\" 5. Modifications may be freely made to this file providing the above .\" conditions are met. .\" -.\" $Id$ +.\" $Id: setproctitle.3,v 1.1 1995/12/26 22:50:08 peter Exp $ .\" .\" The following requests are required for all man pages. .Dd December 16, 1995 @@ -28,8 +28,16 @@ .Nd set the process title for .Xr ps 1 .Sh SYNOPSIS +#include <libutil.h> +.Pp .Ft void .Fn setproctitle "const char *fmt" "..." +.Pp +Link with +.Va -lutil +on the +.Xr cc 1 +command line. .Sh DESCRIPTION The .Nm setproctitle |