core: add BFile_Size syscall

pull/7/head
Alice 3 years ago
parent 3147045196
commit 07e2de981a
  1. 6
      include/gint/bfile.h
  2. 5
      src/core/syscalls.S

@ -52,6 +52,12 @@ int BFile_Open(uint16_t const *file, enum BFile_OpenMode mode);
Returns a BFile error code. */
int BFile_Close(int fd);
/* BFile_Size(): Retrieve size of an open file
@fd File descriptor
Returns the file size in bytes, or a negative BFile error code*/
int BFile_Size(int fd);
/* BFile_Write(): Write data to an open file
Second and third argument specify the data and length to write.

@ -23,6 +23,7 @@
.global _BFile_Create
.global _BFile_Open
.global _BFile_Close
.global _BFile_Size
.global _BFile_Write
.global _BFile_Read
@ -71,6 +72,10 @@ _BFile_Open:
_BFile_Close:
syscall(0x042d)
# int BFile_Size(int handle)
_BFile_Size:
syscall(0x042f)
# int BFile_Write(int handle, const void *ram_buffer, int even_size)
_BFile_Write:
syscall(0x0435)

Loading…
Cancel
Save