Skip to content

Commit 04ad740

Browse files
committed
Adds GETFILEATTRIBUTE processing for INODE_LO and INODE_HI attributes.
1 parent fe7beaf commit 04ad740

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

inc/locfile.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
#define PROTECTION (S_POSITIVE | 6)
3636
#define EOL (S_POSITIVE | 7)
3737
#define ALL (S_POSITIVE | 8)
38+
#define INODE_LO (S_POSITIVE | 9)
39+
#define INODE_HI (S_POSITIVE | 10)
3840

3941
#define ToLispTime(x) ((int)(x) + 29969152)
4042
/* For getfileinfo. For WDATE&RDATE */

src/dsk.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,8 @@ LispPTR DSK_directorynamep(LispPTR *args)
15281528
*
15291529
* Value: If failed, returns Lisp NIL. If succeed, returned value is
15301530
* different according to the attribute requested.
1531-
* In the case of LENGTH, WDATE, RDATE, and PROTECTION, returns Lisp T.
1531+
* In the case of LENGTH, WDATE, RDATE, and PROTECTION, INODE_LO, and
1532+
INODE_HI, returns Lisp T.
15321533
* In the case of AUTHOR and ALL, returns the length of the author name
15331534
* copied into the specified buffer.
15341535
*
@@ -1672,6 +1673,14 @@ LispPTR COM_getfileinfo(LispPTR *args)
16721673
#endif /* DOS */
16731674
return (GetPosSmallp(len));
16741675
}
1676+
case INODE_HI:
1677+
bufp = (unsigned *)NativeAligned4FromLAddr(args[2]);
1678+
*bufp = ((uint64_t)sbuf.st_ino) >> 32;
1679+
return (ATOM_T);
1680+
case INODE_LO:
1681+
bufp = (unsigned *)NativeAligned4FromLAddr(args[2]);
1682+
*bufp = ((uint64_t)sbuf.st_ino) & 0xffffffff;
1683+
return (ATOM_T);
16751684
case ALL: {
16761685
/*
16771686
* The format of the buffer which has been allocated by Lisp

0 commit comments

Comments
 (0)