Displaying 3 results from an estimated 3 matches for "setttyent".
Did you mean:
getttyent
2005 Mar 30
1
utmp update for bsd systems
...y(pstring uname, struct utmp *u, BOOL claim)
{
- DEBUG(1,("pututline_my: not yet implemented\n"));
- /* BSD implementor: may want to consider (or not) adjusting "lastlog" */
+ int fd, topslot;
+ struct utmp ubuf;
+
+ if ((fd = open(uname, O_RDWR, 0)) < 0)
+ return;
+
+ if (!setttyent())
+ return;
+
+ for (topslot = 0; getttyent() != (struct ttyent *)NULL; )
+ topslot++;
+
+ if (!endttyent())
+ return;
+
+ (void) lseek(fd, (off_t)(topslot * sizeof(struct utmp)), SEEK_SET);
+
+ DEBUG(1,("pututline(%s, %s, %d); topslot=%d\n",
+ u->ut_line, u->ut_name, claim,...
2005 Apr 14
1
utmp update for bsd systems (try 2)
...y(pstring uname, struct utmp *u, BOOL claim)
{
- DEBUG(1,("pututline_my: not yet implemented\n"));
- /* BSD implementor: may want to consider (or not) adjusting "lastlog" */
+ int fd, topslot;
+ struct utmp ubuf;
+
+ if ((fd = open(uname, O_RDWR, 0)) < 0)
+ return;
+
+ if (!setttyent())
+ return;
+
+ for (topslot = 0; getttyent() != (struct ttyent *)NULL; )
+ topslot++;
+
+ if (!endttyent())
+ return;
+
+ (void) lseek(fd, (off_t)(topslot * sizeof(struct utmp)), SEEK_SET);
+
+ DEBUG(1,("pututline(%s, %s, %d); topslot=%d\n",
+ u->ut_line, u->ut_name, claim,...
2000 Aug 01
2
[2.1.1p4] utmp patch for SunOS 4.1.x
...54 2000
--- loginrec.c Mon Jul 31 10:37:45 2000
***************
*** 723,730 ****
--- 723,751 ----
int tty;
/* FIXME: (ATL) ttyslot() needs local implementation */
+
+ #if defined(SUNOS4) && defined(HAVE_GETTTYENT)
+
+ register struct ttyent *ty;
+ tty=0;
+ setttyent();
+ while ((struct ttyent *)0 != (ty = getttyent())) {
+ tty++;
+ if(0 == strncmp(ty->ty_name,ut->ut_line,sizeof(ut->ut_line)))
+ break;
+ }
+ endttyent();
+ if((struct ttyent *)0 == ty) {
+ log("utmp_writ...