stat_.c

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· C语言 代码 · 共 47 行

C
47
字号
/*char id_stat[] = "@(#)stat_.c	1.3"; * * get file status * * calling sequence: *	integer stat, statb(12) *	call stat (name, statb) * where: *	'statb' will receive the stat structure for file 'name'. */#include <sys/param.h>#ifndef	MAXPATHLEN#define MAXPATHLEN	128#endif#include <sys/stat.h>#include "../libI77/f_errno.h"long stat_(name, stbuf, namlen)char *name; long *stbuf, namlen;{	char buf[MAXPATHLEN];	struct stat statb;	if (namlen >= sizeof buf)		return((long)(errno=F_ERARG));	g_char(name, namlen, buf);	if (stat(buf, &statb) == 0)	{		*stbuf++ = statb.st_dev;		*stbuf++ = statb.st_ino;		*stbuf++ = statb.st_mode;		*stbuf++ = statb.st_nlink;		*stbuf++ = statb.st_uid;		*stbuf++ = statb.st_gid;		*stbuf++ = statb.st_rdev;		*stbuf++ = statb.st_size;		*stbuf++ = statb.st_atime;		*stbuf++ = statb.st_mtime;		*stbuf++ = statb.st_ctime;		*stbuf++ = statb.st_blksize;		return(0L);	}	return ((long)errno);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?