#include "AFS_component_version_number.c"
-main(argc,argv)
-char **argv;
+void Perror(char *err, int a1, int a2, int a3)
+{
+ char msg[200];
+ sprintf(msg, err, a1, a2, a3);
+ perror(msg);
+}
+
+int main(int argc, char **argv)
{
int error=0;
struct stat status;
int dev, fd, inode;
+
+#if defined(AFS_NT40_ENV) || defined(AFS_NAMEI_ENV)
+ fprintf(stderr, "gi not supported on NT or NAMEI systems.\n");
+ exit(1);
+#else
+
argc--; argv++;
while (argc && **argv == '-') {
if (strcmp(*argv, "-stat") == 0)
inode = atoi(*++argv);
fd = iopen(dev, inode, 0);
if (fd < 0) {
- Perror("Unable to open inode %d", inode);
+ Perror("Unable to open inode %d", inode, 0, 0);
exit(1);
}
if (statflag) {
if (fstat(fd, &status) != 0) {
- Perror("Unable to fstat the inode!");
+ Perror("Unable to fstat the inode!", 0, 0, 0);
exit(1);
}
printf("Inode status: dev=%d, ino=%d, mode=%o, nlink=%d, uid=%d, gid=%d, size=%d, mtime=%d, blocks=%d\n", status.st_dev, status.st_ino, status.st_mode, status.st_nlink, status.st_uid, status.st_gid, status.st_size, status.st_mtime);
write(1, buf, n);
}
exit(0);
-}
-
-Perror(err, a1, a2, a3)
- char *err;
-{
- char msg[200];
- sprintf(msg, err, a1, a2, a3);
- perror(msg);
+#endif /* AFS_NT40_ENV || AFS_NAMEI_ENV */
}