From howardjp@wam.umd.edu Wed Aug 11 05:55:56 1999
Return-Path: <howardjp@wam.umd.edu>
Received: from po4.wam.umd.edu (po4.wam.umd.edu [128.8.10.166])
	by hub.freebsd.org (Postfix) with ESMTP id 9EF7C14BF6
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 11 Aug 1999 05:55:54 -0700 (PDT)
	(envelope-from howardjp@wam.umd.edu)
Received: from rac10.wam.umd.edu (root@rac10.wam.umd.edu [128.8.10.150])
	by po4.wam.umd.edu (8.9.3/8.9.3) with ESMTP id IAA11339
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 11 Aug 1999 08:21:01 -0400 (EDT)
Received: from rac10.wam.umd.edu (sendmail@localhost [127.0.0.1])
	by rac10.wam.umd.edu (8.9.3/8.9.3) with SMTP id IAA04677
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 11 Aug 1999 08:21:00 -0400 (EDT)
Received: (from howardjp@localhost)
	by rac10.wam.umd.edu (8.9.3/8.9.3) id IAA04673
	for FreeBSD-gnats-submit@freebsd.org; Wed, 11 Aug 1999 08:21:00 -0400 (EDT)
Message-Id: <199908111221.IAA04673@rac10.wam.umd.edu>
Date: Wed, 11 Aug 1999 08:21:00 -0400 (EDT)
From: James Howard <howardjp@wam.umd.edu>
Reply-To: howardjp@wam.umd.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: unlink(1) as required by Unix 98
X-Send-Pr-Version: 3.2

>Number:         13074
>Category:       bin
>Synopsis:       unlink(1) as required by Unix 98
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    sheldonh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 11 06:00:03 PDT 1999
>Closed-Date:    Mon Dec 20 08:16:26 PST 1999
>Last-Modified:  Mon Dec 20 08:16:52 PST 1999
>Originator:     James Howard
>Release:        FreeBSD 3.2-STABLE i386
>Organization:
University of Maryland
>Environment:

FreeBSD byzantine 3.2-STABLE FreeBSD 3.2-STABLE #5: Sat Aug  7 23:43:54 GMT 1999     root@byzantine:/usr/src/sys/compile/BYZANTINE  i386

>Description:

After opening my big mouth on freebsd-advocacy about how Unix 98
compliance was a worthy goal, more than one person told me to go
ahead and send in PRs with changes.  Well, here is yet another :)

This contains a shar of unlink(1).  unlink accepts one argument and
runs unlink(2) on it thus removing the object listed.  NetBSD places 
this in /usr/sbin and puts the man page in section 8, but nothing 
in the standard dictates where it should be.  I have the man page
in section 1.  If this is inappropriate, it can be changed without
pain.  This implementation contains no NetBSD code.

>How-To-Repeat:

Irrelevant.

>Fix:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	Makefile
#	unlink.1
#	unlink.c
#
echo x - Makefile
sed 's/^X//' >Makefile << 'END-of-Makefile'
XPROG=	unlink
X
X.include <bsd.prog.mk>
END-of-Makefile
echo x - unlink.1
sed 's/^X//' >unlink.1 << 'END-of-unlink.1'
X.\" Copyright (c) 1999 James Howard
X.\" All rights reserved.
X.\"
X.\" Redistribution and use in source and binary forms, with or without
X.\" modification, are permitted provided that the following conditions
X.\" are met:
X.\" 1. Redistributions of source code must retain the above copyright
X.\"    notice, this list of conditions and the following disclaimer.
X.\" 2. Redistributions in binary form must reproduce the above copyright
X.\"    notice, this list of conditions and the following disclaimer in the
X.\"    documentation and/or other materials provided with the distribution.
X.\"
X.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X.\" SUCH DAMAGE.
X.\"
X.\"
X.\"     $Id$
X.\"
X.Dd August 10, 1999
X.Dt UNLINK 1
X.Os
X.Sh NAME
X.Nm unlink
X.Nd call the
X.Xr unlink 2
Xfunction
X.Sh SYNOPSIS
X.Nm unlink
X.Ar file
X.Sh DESCRIPTION
X.Nm Unlink 
Xand remove
X.Ar file
Xfrom the file system.
X.Sh USAGE
XThe
X.Nm
Xutility will remove a single file or direectory entry 
Xand decrements the link count of the file which was 
Xreferenced by
X.Ar file .
XA directory may not be specified by
X.Ar file .
X.Sh SEE ALSO
X.Xr link 1 ,
X.Xr rm 1 ,
X.Xr unlink 2
X.Sh STANDARDS
XThe
X.Nm
Xutility is expected to be XPG5 compliant.END-of-unlink.1
echo x - unlink.c
sed 's/^X//' >unlink.c << 'END-of-unlink.c'
X/*-
X * Copyright (c) 1999 James Howard
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X *    notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X *    notice, this list of conditions and the following disclaimer in the
X *    documentation and/or other materials provided with the distribution.
X *
X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X *
X *      $Id$
X */
X
X#include <err.h>
X#include <stdio.h>
X#include <unistd.h>
X
Xvoid help(void);
X
Xint main(int argc, char **argv) 
X{
X	int e;
X	
X	if(argc != 2)
X		help();
X	
X	if((e = unlink(argv[1])) != 0)
X		err(!e, "%s", argv[1]);
X	
X	return 0;
X}
X
Xvoid help(void) 
X{
X	
X	fprintf(stderr, "usage: unlink file\n");
X	exit(1);
X}
END-of-unlink.c
exit


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sheldonh 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Wed Sep 8 07:07:25 PDT 1999 
Responsible-Changed-Why:  
James and I are discussing PR 13070, PR 13071 and PR 13074, which are 
all related. 
State-Changed-From-To: open->closed 
State-Changed-By: sheldonh 
State-Changed-When: Mon Dec 20 08:16:26 PST 1999 
State-Changed-Why:  
Implemented as a special case of rm(1).  Since 3.4-RELEASE is  
expected to be the last release on the RELENG_3 branch, this 
will not be merged from CURRENT. 
>Unformatted:
