#include "scheme.h"
#include "prims.h"
#include "ux.h"
+#include "uxio.h"
#include "osfs.h"
+#include "osio.h"
+extern void UX_read_fd_status (int fd, struct stat * s);
extern int UX_read_file_status (const char * filename, struct stat * s);
extern int UX_read_file_status_indirect
(const char * filename, struct stat * s);
The file_mode_string stuff was gobbled from GNU Emacs. */
+DEFINE_PRIMITIVE ("CHANNEL-FILE-ATTRIBUTES", Prim_channel_file_attributes, 1, 1, 0)
+{
+ struct stat s;
+ PRIMITIVE_HEADER (1);
+ UX_read_fd_status ((CHANNEL_DESCRIPTOR (arg_channel (1))), (&s));
+ return (file_attributes_internal (&s));
+}
+
#define FILE_ATTRIBUTES_PRIMITIVE(stat_syscall) \
{ \
struct stat s; \
} \
} while (0)
+void
+UX_read_fd_status (int fd, struct stat * s)
+{
+ STD_VOID_SYSTEM_CALL (syscall_fstat, (UX_fstat (fd, s)));
+}
+
int
UX_read_file_status (const char * filename, struct stat * s)
{