stew

a monorepo of some sort
git clone git://git.nsmpr.xyz/stew.git
Log | Files | Refs

libbtr.c (512B)


      1 #include <u.h>
      2 #include <libc.h>
      3 
      4 #include <btr.h>
      5 
      6 Btrctl *
      7 initbtr(char *path)
      8 {
      9 	Btrctl *bc;
     10 	int fd;
     11 	if (path == nil) path = "/mnt/btr/data";
     12 	fd = open(path, OREAD|OWRITE);
     13 	if (fd < 0) return nil;
     14 	bc = mallocz(sizeof(Btrctl), 1);
     15 	bc->fd = fd;
     16 	return bc;
     17 }
     18 
     19 Btrstat
     20 bstat(Btrctl *bc, vlong id)
     21 {
     22 	return (Btrstat){0, 0, 0};
     23 }
     24 
     25 long bpread(Btrctl *bc, vlong id, void *buf, long nbytes, vlong offset)
     26 {
     27 	return 0;
     28 }
     29 
     30 long bpwrite(Btrctl *bc, vlong id, void *buf, long nbytes, vlong offset)
     31 {
     32 	return 0;
     33 }