Move minix/paths.h to paths.h

Also, merge in relevant macros from NetBSD
This commit is contained in:
Arun Thomas 2010-11-06 20:40:15 +00:00
parent 0e6dcf027f
commit 998af6f111
29 changed files with 106 additions and 62 deletions

View file

@ -31,7 +31,7 @@ YFLAGS= -d
EDIT=-DEDITLINE
# Enable this line if your system does not have a <paths.h>
NO_PATHS_H=-DNO_PATHS_H
#NO_PATHS_H=-DNO_PATHS_H
# Enable this if you don't want job control
NO_JOBS=-DJOBS=0

View file

@ -5,7 +5,7 @@
#define nil ((void*)0)
#include <minix/paths.h>
#include <paths.h>
/* Paths to files. */
#define PATH_DHCPCONF _PATH_DHCPCONF

View file

@ -28,7 +28,7 @@
#include <errno.h>
#include <fcntl.h>
#include <fnmatch.h>
#include <minix/paths.h>
#include <paths.h>
#include <sys/statfs.h>
#include <stdio.h>
#include <stdlib.h>

View file

@ -20,6 +20,6 @@
* Materiel Command, USAF, under agreement number F39502-99-1-0512.
*/
#include <minix/paths.h>
#include <paths.h>
#define _PATH_PR "/usr/bin/pr"

View file

@ -97,7 +97,7 @@ struct person { /* one for each person fingered */
char hostt[HMAX+1]; /* login host */
};
#include <minix/paths.h>
#include <paths.h>
char LASTLOG[] = _PATH_LASTLOG; /* last login info */
char USERLOG[] = _PATH_UTMP; /* who is logged in */

View file

@ -30,7 +30,7 @@ Created: Jan 27, 1992 by Philip Homburg
#include <net/gen/resolv.h>
#include <net/gen/dhcp.h>
#include <minix/paths.h>
#include <paths.h>
char *prog_name;

View file

@ -57,7 +57,7 @@
#include <stdio.h>
#include <errno.h>
#include <minix/paths.h>
#include <paths.h>
#define FALSE 0
#define TRUE 1

View file

@ -75,7 +75,7 @@
#include <time.h>
#include <sys/utsname.h>
#include <minix/minlib.h>
#include <minix/paths.h>
#include <paths.h>
char PATH_UTMP[] = _PATH_UTMP; /* current logins */
char PATH_WTMP[] = _PATH_WTMP; /* login/logout history */

View file

@ -31,7 +31,7 @@
* @(#)pathnames.h 8.3 (Berkeley) 1/2/94
*/
#include <minix/paths.h>
#include <paths.h>
#define _PATH_MANCONF "/etc/man.conf"
#define _PATH_PAGER "/usr/bin/more -s"

View file

@ -23,7 +23,7 @@
#include <utmp.h>
#include <errno.h>
#include <minix/paths.h>
#include <paths.h>
char PATH_UTMP[] = _PATH_UTMP; /* current logins */

View file

@ -41,7 +41,7 @@ static const char version[] = "2.7";
#include <net/gen/udp_io.h>
#include <net/gen/dhcp.h>
#include <minix/paths.h>
#include <paths.h>
#define HTTL 3600L /* Default time to live for /etc/hosts data. */
#define SHORT_TIMEOUT 2 /* If you expect an answer soon. */

View file

@ -9,6 +9,6 @@
* on July 29, 2003.
*/
#include <minix/paths.h>
#include <paths.h>
#define _PATH_ED "/bin/ed"

View file

@ -39,7 +39,7 @@
#include <errno.h>
#include <fcntl.h>
#include <libgen.h>
#include <minix/paths.h>
#include <paths.h>
#include <signal.h>
#include <stdarg.h>
#include <stdlib.h>

View file

@ -50,7 +50,7 @@ static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94";
#include <unistd.h>
#include <stdlib.h>
#include <limits.h>
#include <minix/paths.h>
#include <paths.h>
#include <sys/types.h>
#include <string.h>

View file

@ -50,7 +50,7 @@ static char sccsid[] = "@(#)pax.c 8.2 (Berkeley) 4/18/94";
#include <errno.h>
#include <fcntl.h>
#include <locale.h>
#include <minix/paths.h>
#include <paths.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>

View file

@ -53,7 +53,7 @@
#include <minix/config.h>
#include <minix/endpoint.h>
#include <minix/paths.h>
#include <paths.h>
#include <minix/procfs.h>
#include <limits.h>
#include <sys/types.h>
@ -229,10 +229,10 @@ PRIVATE void getkinfo(void)
FILE *fp;
if ((fp = fopen("kinfo", "r")) == NULL)
err("Unable to open " _PATH_PROC "/kinfo");
err("Unable to open " _PATH_PROC "kinfo");
if (fscanf(fp, "%u %u", &nr_procs, &nr_tasks) != 2)
err("Unable to read from " _PATH_PROC "/kinfo");
err("Unable to read from " _PATH_PROC "kinfo");
fclose(fp);
}

View file

@ -1,5 +1,5 @@
#include <minix/paths.h>
#include <paths.h>
#include <sys/ioc_memory.h>
#include <stdio.h>

View file

@ -24,7 +24,7 @@
#include <minix/rs.h>
#include <minix/syslib.h>
#include <minix/bitmap.h>
#include <minix/paths.h>
#include <paths.h>
#include <minix/sef.h>
#include <minix/dmap.h>
#include <sys/types.h>

View file

@ -335,7 +335,7 @@
/* #undef HAVE_OPENSSL_SHA_H */
/* Define to 1 if you have the <paths.h> header file. */
/* #undef HAVE_PATHS_H */
#define HAVE_PATHS_H 1
/* Define to 1 if you have the `pipe' function. */
#define HAVE_PIPE 1

View file

@ -33,7 +33,7 @@
#include <minix/endpoint.h>
#include <minix/const.h>
#include <minix/u64.h>
#include <minix/paths.h>
#include <paths.h>
#include <minix/procfs.h>
u32_t system_hz;
@ -544,12 +544,12 @@ void getkinfo(void)
FILE *fp;
if ((fp = fopen("kinfo", "r")) == NULL) {
fprintf(stderr, "opening " _PATH_PROC "/kinfo failed\n");
fprintf(stderr, "opening " _PATH_PROC "kinfo failed\n");
exit(1);
}
if (fscanf(fp, "%u %u", &nr_procs, &nr_tasks) != 2) {
fprintf(stderr, "reading from " _PATH_PROC "/kinfo failed\n");
fprintf(stderr, "reading from " _PATH_PROC "kinfo failed\n");
exit(1);
}

View file

@ -10,7 +10,7 @@
#include <utmp.h>
#include <time.h>
#include <string.h>
#include <minix/paths.h>
#include <paths.h>
char PATH_UTMP[] = _PATH_UTMP;

View file

@ -25,7 +25,7 @@
#include <utmp.h>
#include <time.h>
#include <stdio.h>
#include <minix/paths.h>
#include <paths.h>
static char *Version = "@(#) WRITE 1.6 (10/24/92)";

View file

@ -10,7 +10,7 @@ INCS= alloca.h ansi.h a.out.h ar.h assert.h configfile.h ctype.h \
syslog.h tar.h termcap.h termios.h time.h timers.h tools.h \
ttyent.h ucontext.h unistd.h utime.h utmp.h wchar.h wctype.h \
hgfs.h tzfile.h util.h fetch.h mpool.h ndbm.h db.h poll.h resolv.h \
memory.h
memory.h paths.h
INCS+= arpa/inet.h arpa/nameser.h
INCS+= minix/a.out.h minix/bitmap.h minix/callnr.h minix/cdrom.h \
minix/com.h minix/config.h minix/const.h minix/cpufeature.h \
@ -21,7 +21,7 @@ INCS+= minix/a.out.h minix/bitmap.h minix/callnr.h minix/cdrom.h \
minix/drivers.h minix/drvlib.h minix/ds.h minix/endpoint.h \
minix/fslib.h minix/ioctl.h minix/ipc.h minix/ipcconst.h \
minix/keymap.h minix/minlib.h minix/mq.h minix/mthread.h \
minix/netdriver.h minix/partition.h minix/paths.h \
minix/netdriver.h minix/partition.h \
minix/portio.h minix/priv.h minix/procfs.h minix/profile.h \
minix/queryparam.h \
minix/rs.h minix/safecopies.h minix/sched.h minix/sef.h minix/sound.h \

View file

@ -1,28 +0,0 @@
#ifndef _MINIX_PATHS_H
#define _MINIX_PATHS_H 1
#define _PATH_DHCPCONF "/etc/dhcp.conf"
#define _PATH_DHCPPID "/usr/run/dhcpd.pid"
#define _PATH_DHCPCACHE "/usr/adm/dhcp.cache"
#define _PATH_DHCPPOOL "/usr/adm/dhcp.pool"
#define _PATH_WTMP "/usr/adm/wtmp"
#define _PATH_UTMP "/etc/utmp"
#define _PATH_LASTLOG "/usr/adm/lastlog"
#define _PATH_MOTD "/etc/motd"
#define _PATH_HOSTS "/etc/hosts"
#define _PATH_DEFTAPE "/dev/sa0"
#define _PATH_RAMDISK "/dev/ram"
#define _PATH_TTY "/dev/tty"
#define _PATH_TMP "/tmp"
#define _PATH_DEVNULL "/dev/null"
#define _PATH_BSHELL "/bin/sh"
#define _PATH_SERVICE "/bin/service"
#define _PATH_SYSTEM_CONF "/etc/system.conf"
#define _PATH_SYSTEM_CONF_DIR "/etc/system.conf.d"
#define _PATH_PROC "/proc"
#endif

72
include/paths.h Normal file
View file

@ -0,0 +1,72 @@
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, 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. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)paths.h 8.1 (Berkeley) 6/2/93
*/
#ifndef _PATHS_H
#define _PATHS_H
/* Default search path. */
#define _PATH_DEFPATH "/usr/bin:/bin:/usr/pkg/bin:/usr/local/bin"
/* All standard utilities path. */
#define _PATH_STDPATH \
"/usr/bin:/bin:/usr/sbin:/sbin:/usr/pkg/bin:/usr/pkg/sbin:/usr/local/bin:/usr/local/sbin"
#define _PATH_DHCPCONF "/etc/dhcp.conf"
#define _PATH_DHCPPID "/usr/run/dhcpd.pid"
#define _PATH_DHCPCACHE "/usr/adm/dhcp.cache"
#define _PATH_DHCPPOOL "/usr/adm/dhcp.pool"
#define _PATH_WTMP "/usr/adm/wtmp"
#define _PATH_UTMP "/etc/utmp"
#define _PATH_LASTLOG "/usr/adm/lastlog"
#define _PATH_MOTD "/etc/motd"
#define _PATH_HOSTS "/etc/hosts"
#define _PATH_DEFTAPE "/dev/sa0"
#define _PATH_RAMDISK "/dev/ram"
#define _PATH_TTY "/dev/tty"
#define _PATH_DEVNULL "/dev/null"
#define _PATH_CONSOLE "/dev/console"
#define _PATH_KMEM "/dev/kmem"
#define _PATH_MEM "/dev/mem"
#define _PATH_RANDOM "/dev/random"
#define _PATH_URANDOM "/dev/urandom"
#define _PATH_BSHELL "/bin/sh"
#define _PATH_SERVICE "/bin/service"
#define _PATH_SYSTEM_CONF "/etc/system.conf"
#define _PATH_SYSTEM_CONF_DIR "/etc/system.conf.d"
/* Provide trailing slash, since mostly used for building pathnames. */
#define _PATH_DEV "/dev/"
#define _PATH_TMP "/tmp/"
#define _PATH_PROC "/proc/"
#endif

View file

@ -335,7 +335,7 @@
/* #undef HAVE_OPENSSL_SHA_H */
/* Define to 1 if you have the <paths.h> header file. */
/* #undef HAVE_PATHS_H */
#define HAVE_PATHS_H 1
/* Define to 1 if you have the `pipe' function. */
#define HAVE_PIPE 1

View file

@ -9,7 +9,7 @@
#include <sys/stat.h>
#include <minix/syslib.h>
#include <minix/rs.h>
#include <minix/paths.h>
#include <paths.h>
#define OK 0
#define FSPATH "/sbin/"

View file

@ -11,7 +11,7 @@
#include <unistd.h>
#include <time.h>
#include <stdio.h>
#include <minix/paths.h>
#include <paths.h>
PRIVATE u32_t get_hz(void)
{
@ -19,7 +19,7 @@ PRIVATE u32_t get_hz(void)
u32_t hz;
int r;
if ((fp = fopen(_PATH_PROC "/hz", "r")) != NULL)
if ((fp = fopen(_PATH_PROC "hz", "r")) != NULL)
{
r = fscanf(fp, "%lu", &hz);

View file

@ -1,6 +1,6 @@
#include <sys/types.h>
#include <minix/paths.h>
#include <paths.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@ -17,7 +17,7 @@ int getloadavg(double *loadavg, int nelem)
return -1;
}
if((fp = fopen(_PATH_PROC "/loadavg", "r")) == NULL)
if((fp = fopen(_PATH_PROC "loadavg", "r")) == NULL)
return -1;
for(i = 0; i < nelem; i++)