diff options
| author | Peter Wemm <peter@FreeBSD.org> | 1996-01-01 08:27:41 +0000 |
|---|---|---|
| committer | Peter Wemm <peter@FreeBSD.org> | 1996-01-01 08:27:41 +0000 |
| commit | 3b7e1cc80ffe102239ea20f8ea00eb74bebbc4e9 (patch) | |
| tree | aac25102c388712f99b4b8c8c49d800d87028e5a | |
| parent | cd5e85eb474d524f6dd5c9809b8cfd504960a901 (diff) | |
Notes
| -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 dffed301898e..5eefe609d103 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 47366cc3387e..0ad1151abe9b 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 000000000000..3f32d7ac0c06 --- /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 911c2892d204..3e68563a9113 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 5692637fdc49..a5b19ba1c2b7 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 11da24f1c80c..d8cf3c870249 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 d55ac9e9413c..f4a6408d659c 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 5aecbfbf2f79..515ff9eb437b 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 dffed301898e..5eefe609d103 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 |
