From 04ad740ead54c36f4a17e08b72a59ee93ab7cb2f Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Mon, 18 Aug 2025 23:05:53 -0700 Subject: [PATCH] Adds GETFILEATTRIBUTE processing for INODE_LO and INODE_HI attributes. --- inc/locfile.h | 2 ++ src/dsk.c | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/inc/locfile.h b/inc/locfile.h index 658975e..5dc8b2c 100644 --- a/inc/locfile.h +++ b/inc/locfile.h @@ -35,6 +35,8 @@ #define PROTECTION (S_POSITIVE | 6) #define EOL (S_POSITIVE | 7) #define ALL (S_POSITIVE | 8) +#define INODE_LO (S_POSITIVE | 9) +#define INODE_HI (S_POSITIVE | 10) #define ToLispTime(x) ((int)(x) + 29969152) /* For getfileinfo. For WDATE&RDATE */ diff --git a/src/dsk.c b/src/dsk.c index 77cd3f5..44104dd 100644 --- a/src/dsk.c +++ b/src/dsk.c @@ -1528,7 +1528,8 @@ LispPTR DSK_directorynamep(LispPTR *args) * * Value: If failed, returns Lisp NIL. If succeed, returned value is * different according to the attribute requested. - * In the case of LENGTH, WDATE, RDATE, and PROTECTION, returns Lisp T. + * In the case of LENGTH, WDATE, RDATE, and PROTECTION, INODE_LO, and + INODE_HI, returns Lisp T. * In the case of AUTHOR and ALL, returns the length of the author name * copied into the specified buffer. * @@ -1672,6 +1673,14 @@ LispPTR COM_getfileinfo(LispPTR *args) #endif /* DOS */ return (GetPosSmallp(len)); } + case INODE_HI: + bufp = (unsigned *)NativeAligned4FromLAddr(args[2]); + *bufp = ((uint64_t)sbuf.st_ino) >> 32; + return (ATOM_T); + case INODE_LO: + bufp = (unsigned *)NativeAligned4FromLAddr(args[2]); + *bufp = ((uint64_t)sbuf.st_ino) & 0xffffffff; + return (ATOM_T); case ALL: { /* * The format of the buffer which has been allocated by Lisp