Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Aug 1999 08:20:58 -0400 (EDT)
From:      James Howard <howardjp@wam.umd.edu>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/13071: link(1) as required by Unix 98
Message-ID:  <199908111220.IAA04666@rac10.wam.umd.edu>

next in thread | raw e-mail | index | archive | help

>Number:         13071
>Category:       bin
>Synopsis:       link(1) as required by Unix 98
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 11 05:30:02 PDT 1999
>Closed-Date:
>Last-Modified:
>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 another :)

This contains a shar of link(1).  link accepts two arguments and
runs link(2) on them thus creating a hard link.  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
#	link.1
#	link.c
#
echo x - Makefile
sed 's/^X//' >Makefile << 'END-of-Makefile'
XPROG=	link
X
X.include <bsd.prog.mk>
END-of-Makefile
echo x - link.1
sed 's/^X//' >link.1 << 'END-of-link.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 LINK 1
X.Os
X.Sh NAME
X.Nm link
X.Nd call the
X.Xr link 2
Xfunction
X.Sh SYNOPSIS
X.Nm link
X.Ar file1 file2
X.Sh DESCRIPTION
XThe 
X.Nm
Xutility calls
X.Xr link 2
Xwith the arguments
X.Ar file2
Xand
X.Ar file1 .
X.Sh USAGE
X.Nm Link
Xcreates a hard link from the source file
X.Ar file1
Xdestination file
X.Ar file2 .
X.Sh SEE ALSO
X.Xr ln 1 ,
X.Xr unlink 1 ,
X.Xr link 2 ,
X.Xr unlink 2
X.Sh STANDARDS
XThe
X.Nm
Xutility is expected to be
XXPG5 
Xcompliant.END-of-link.1
echo x - link.c
sed 's/^X//' >link.c << 'END-of-link.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 != 3)
X		help();
X	
X	if((e = link(argv[1], argv[2])) != 0)
X		err(!e, "%s", argv[1]);
X	
X	return 0;
X}
X
Xvoid help(void) 
X{
X	
X	fprintf(stderr, "usage: link file1 file2\n");
X	exit(1);
X}
END-of-link.c
exit


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199908111220.IAA04666>