CS318 - Pintos
Pintos source browser for JHU CS318 course
create-long.c
Go to the documentation of this file.
1 /** Tries to create a file with a name that is much too long,
2  which must fail. */
3 
4 #include <string.h>
5 #include <syscall.h>
6 #include "tests/lib.h"
7 #include "tests/main.h"
8 
9 void
10 test_main (void)
11 {
12  static char name[512];
13  memset (name, 'x', sizeof name);
14  name[sizeof name - 1] = '\0';
15 
16  msg ("create(\"x...\"): %d", create (name, 0));
17 }
name
char * name[]
Definition: insult.c:47
lib.h
string.h
main.h
test_main
void test_main(void)
Tries to create a file with a name that is much too long, which must fail.
Definition: create-long.c:10
msg
void msg(const char *format,...)
Definition: lib.c:28
memset
void * memset(void *dst_, int value, size_t size)
Sets the SIZE bytes in DST to VALUE.
Definition: string.c:279
create
bool create(const char *file, unsigned initial_size)
Definition: syscall.c:91