move striping from install command to CFLAGS
now using gcc -fweb and -frename-registers options
avoid warning about -lncurses when not linking -- thanks FLWM
+tolerate IA-64 headers without PAGE_SIZE
watch: allow sub-second intervals -- thanks Thomas Stewart
sysctl: -q option
sysctl: better error handling of failed writes
#include "version.h"
#include "devname.h"
-#include <asm/page.h>
-#ifndef PAGE_SIZE
-#define PAGE_SIZE (sizeof(long)*1024)
-#endif
+// This is the buffer size for a tty name. Any path is legal,
+// which makes PAGE_SIZE appropriate (see kernel source), but
+// that is only 99% portable and utmp only holds 32 anyway.
+#define NAME_SIZE 128
/* Who uses what:
*
char path[32];
int count;
sprintf(path, "/proc/%d/%s", pid, name); /* often permission denied */
- count = readlink(path,buf,PAGE_SIZE-1);
+ count = readlink(path,buf,NAME_SIZE-1);
if(count == -1) return 0;
buf[count] = '\0';
if(stat(buf, &sbuf) < 0) return 0;
/* number --> name */
unsigned dev_to_tty(char *restrict ret, unsigned chop, dev_t dev_t_dev, int pid, unsigned int flags) {
- static char buf[PAGE_SIZE];
+ static char buf[NAME_SIZE];
char *restrict tmp = buf;
unsigned dev = dev_t_dev;
unsigned i = 0;