__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" #define UTMPFILE "/etc/utmp"
#ifdef USG #ifdef __USG
struct utmp { struct utmp {
char ut_name[8]; char ut_name[8];
char ut_id[4]; char ut_id[4];
@ -17,7 +17,7 @@ struct utmp {
struct utmp { struct utmp {
char ut_line[8]; char ut_line[8];
char ut_name[8]; char ut_name[8];
#ifdef BSD4_2 #ifdef __BSD4_2
char ut_host[16]; char ut_host[16];
#endif #endif
long ut_time; long ut_time;

View file

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

View file

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

View file

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

View file

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