Skip to content

Commit

Permalink
servers: added structures for opendir() and readdir() messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jewelcodes committed Sep 25, 2024
1 parent b7dfc7f commit 127ee68
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/include/kernel/servers.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <stdint.h>
#include <kernel/sched.h>
#include <kernel/file.h>
#include <kernel/dirent.h>
#include <sys/stat.h>

#define SERVER_MAX_CONNECTIONS 128
Expand Down Expand Up @@ -40,6 +41,8 @@
#define COMMAND_READ 0x8005
#define COMMAND_WRITE 0x8006
#define COMMAND_IOCTL 0x8007
#define COMMAND_OPENDIR 0x8008
#define COMMAND_READDIR 0x8009

#define MAX_SYSCALL_COMMAND 0x8007

Expand Down Expand Up @@ -156,6 +159,22 @@ typedef struct {
unsigned long parameter;
} IOCTLCommand;

/* opendir() */
typedef struct {
SyscallHeader header;
char path[MAX_FILE_PATH];
uid_t uid;
gid_t gid;
} OpendirCommand;

/* readdir() */
typedef struct {
SyscallHeader header;
char path[MAX_FILE_PATH];
size_t position;
dirent entry;
} ReaddirCommand;

void serverInit();
void serverIdle();
void handleGeneralRequest(int, const MessageHeader *, void *);
Expand Down

0 comments on commit 127ee68

Please sign in to comment.