いつかまとめる予定
メモ書き
まずはソースコード
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <pwd.h>
#define BUF 256
int main(void)
{
int p;
char buf[800];
int rfp = 0;
struct stat sb;
struct passwd *k;
rfp = open("/proc/2583/stat",O_RDONLY);
printf("%d\n",rfp);
fstat(rfp,&sb);
p = sb.st_uid;
k = getpwuid(p);
if ( k )
printf("%s\n",k->pw_name);
else
printf("%d",p);
}