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.
This commit is contained in:
Peter Wemm 1996-01-01 08:27:41 +00:00
parent cd5e85eb47
commit 3b7e1cc80f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=13137
9 changed files with 80 additions and 3 deletions

View File

@ -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

View File

@ -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>

44
lib/libutil/libutil.h Normal file
View File

@ -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_ */

View File

@ -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)

View File

@ -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;
{

View File

@ -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;

View File

@ -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;
{

View File

@ -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;

View File

@ -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