Hello,
I try to play with utmpx and found strange problem.
tty(1) shows me that I'm at pts/11
But when I run a small program:
getutxline(3) can't find entry about pts/11.
who(1) and getent(1) also silent about pts/11.
What does it mean?
p.s. I use 9.0-STABLE FreeBSD 9.0-STABLE #0: Sat Jan 14 02:35:27 MSK 2012
I try to play with utmpx and found strange problem.
tty(1) shows me that I'm at pts/11
Code:
0tyl2~(8)>tty
/dev/pts/11
0tyl2~(9)>
But when I run a small program:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <utmpx.h>
#define MYTTY "pts/11"
int main(int argc, char *argv[]) {
struct utmpx *ut;
ut = (struct utmpx *) malloc(sizeof(struct utmpx));
strncpy(ut->ut_line, MYTTY, sizeof(MYTTY));
if ((ut = getutxline(ut)) == NULL) {
perror("getutxline");
return (1);
}
printf("tty: %s\n", ut->ut_line);
return (0);
}
getutxline(3) can't find entry about pts/11.
who(1) and getent(1) also silent about pts/11.
What does it mean?
p.s. I use 9.0-STABLE FreeBSD 9.0-STABLE #0: Sat Jan 14 02:35:27 MSK 2012