PKUOS - Pintos
Pintos source browser for PKU Operating System 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
9void
10test_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}
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
char * name[]
Definition: insult.c:47
bool create(const char *file, unsigned initial_size)
Definition: syscall.c:91
void msg(const char *format,...)
Definition: lib.c:28
void * memset(void *dst_, int value, size_t size)
Sets the SIZE bytes in DST to VALUE.
Definition: string.c:279