__USG and __BSD4_2 introduced, dysize added

This commit is contained in:
ceriel 1987-03-10 15:07:26 +00:00
parent 6852a8ef39
commit 76fea1fbca
5 changed files with 20 additions and 14 deletions

View file

@ -1,6 +1,6 @@
#define UTMPFILE "/etc/utmp"
#ifdef USG
#ifdef __USG
struct utmp {
char ut_name[8];
char ut_id[4];
@ -17,7 +17,7 @@ struct utmp {
struct utmp {
char ut_line[8];
char ut_name[8];
#ifdef BSD4_2
#ifdef __BSD4_2
char ut_host[16];
#endif
long ut_time;

View file

@ -16,6 +16,12 @@ last_sunday(d, t)
return d - (d - first) % 7;
}
dysize(y)
{
/* compatibility */
return YEARSIZE(y);
}
extern struct tm *gmtime();
struct tm *

View file

@ -1,7 +1,7 @@
#include <sys/types.h>
#include <sys/dir.h>
#ifndef BSD4_2
#ifndef __BSD4_2
/*
* read an old stlye directory entry and present it as a new one
*/
@ -32,7 +32,7 @@ register DIR *dirp;
dirp->dd_size = 0;
return NULL;
}
#ifdef BSD4_2
#ifdef __BSD4_2
if (! ((struct direct *) dirp->dd_buf)->d_ino) {
dirp->dd_loc += ((struct direct *)dirp->dd_buf)->d_reclen;
}
@ -43,7 +43,7 @@ register DIR *dirp;
continue;
}
dp = (struct olddirect *) (dirp->dd_buf + dirp->dd_loc);
#ifndef BSD4_2
#ifndef __BSD4_2
dirp->dd_loc += sizeof (struct olddirect);
if (dp->od_ino == 0)
continue;

View file

@ -1,4 +1,4 @@
#ifdef USG
#ifdef __USG
/* system V, so no /etc/ttys file. In this case, scan the
/etc/utmp file
*/
@ -27,7 +27,7 @@ ttyslot()
register char *tp, *p;
int fd;
int retval = 1;
#ifdef USG
#ifdef __USG
struct utmp buf;
#else
char buf[32];
@ -40,7 +40,7 @@ ttyslot()
else
p++;
if ((fd = open(FILENAME, 0)) < 0) return 0;
#ifdef USG
#ifdef __USG
while (read(fd, (char *) &buf, sizeof(buf)) == sizeof(buf)) {
/* processes associated with a terminal ...
unfortunately we cannot use the include file because

View file

@ -1,4 +1,4 @@
#ifdef BSD4_2
#ifdef __BSD4_2
struct timeval {
long tv_sec, tv_usec;
};
@ -6,7 +6,7 @@ struct timezone {
int tz_minuteswest, tz_dsttime;
};
#else
#ifndef USG
#ifndef __USG
#include <sys/types.h>
struct timeb
{
@ -18,7 +18,7 @@ struct timeb
#endif
#endif
#ifdef USG
#ifdef __USG
long timezone = -1 * 60;
int daylight = 1;
char *tzname[] = {"MET", "MDT",};
@ -30,7 +30,7 @@ char *__tzname[] = {"MET", "MDT", };
tzset()
{
#ifdef BSD4_2
#ifdef __BSD4_2
struct timeval tval;
struct timezone tzon;
@ -38,7 +38,7 @@ tzset()
__timezone = tzon.tz_minuteswest * 60L;
__daylight = tzon.tz_dsttime;
#else
#ifndef USG
#ifndef __USG
struct timeb time;
ftime(&time);
@ -70,7 +70,7 @@ tzset()
strncpy(__tzname[1], p, 3);
}
}
#ifdef USG
#ifdef __USG
timezone = __timezone;
daylight = __daylight;
tzname[0] = __tzname[0];