sock.c (31183) | sock.c (34739) |
---|---|
1/* 2 * sock.c (C) 1995-1997 Darren Reed 3 * 4 * Redistribution and use in source and binary forms are permitted 5 * provided that this notice is preserved and due credit is given 6 * to the original author and the contributors. 7 */ 8#if !defined(lint) 9static const char sccsid[] = "@(#)sock.c 1.2 1/11/96 (C)1995 Darren Reed"; | 1/* 2 * sock.c (C) 1995-1997 Darren Reed 3 * 4 * Redistribution and use in source and binary forms are permitted 5 * provided that this notice is preserved and due credit is given 6 * to the original author and the contributors. 7 */ 8#if !defined(lint) 9static const char sccsid[] = "@(#)sock.c 1.2 1/11/96 (C)1995 Darren Reed"; |
10static const char rcsid[] = "@(#)$Id: sock.c,v 2.0.2.9 1997/09/28 07:13:37 darrenr Exp $"; | 10static const char rcsid[] = "@(#)$Id: sock.c,v 2.0.2.9.2.1 1997/11/28 03:36:01 darrenr Exp $"; |
11#endif 12#include <stdio.h> 13#include <unistd.h> 14#include <string.h> 15#include <stdlib.h> 16#include <stddef.h> 17#include <pwd.h> 18#include <sys/types.h> --- 229 unchanged lines hidden (view full) --- 248 int mib[4]; 249 size_t n; 250 251 mib[0] = CTL_KERN; 252 mib[1] = KERN_PROC; 253 mib[2] = KERN_PROC_PID; 254 mib[3] = pid; 255 | 11#endif 12#include <stdio.h> 13#include <unistd.h> 14#include <string.h> 15#include <stdlib.h> 16#include <stddef.h> 17#include <pwd.h> 18#include <sys/types.h> --- 229 unchanged lines hidden (view full) --- 248 int mib[4]; 249 size_t n; 250 251 mib[0] = CTL_KERN; 252 mib[1] = KERN_PROC; 253 mib[2] = KERN_PROC_PID; 254 mib[3] = pid; 255 |
256 n = 1; | 256 n = sizeof(kp); |
257 if (sysctl(mib, 4, &kp, &n, NULL, 0) == -1) 258 { 259 perror("sysctl"); 260 return NULL; 261 } 262 return &kp; 263} 264 --- 131 unchanged lines hidden --- | 257 if (sysctl(mib, 4, &kp, &n, NULL, 0) == -1) 258 { 259 perror("sysctl"); 260 return NULL; 261 } 262 return &kp; 263} 264 --- 131 unchanged lines hidden --- |