MCPcopy Create free account
hub / github.com/ading2210/linuxpdf / fs_mkdir

Function fs_mkdir

tinyemu/fs_disk.c:213–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211
212
213static int fs_mkdir(FSDevice *fs, FSQID *qid, FSFile *f,
214 const char *name, uint32_t mode, uint32_t gid)
215{
216 char *path;
217 struct stat st;
218
219 path = compose_path(f->path, name);
220 if (mkdir(path, mode) < 0) {
221 free(path);
222 return -errno_to_p9(errno);
223 }
224 if (lstat(path, &st) != 0) {
225 free(path);
226 return -errno_to_p9(errno);
227 }
228 free(path);
229 stat_to_qid(qid, &st);
230 return 0;
231}
232
233static int fs_open(FSDevice *fs, FSQID *qid, FSFile *f, uint32_t flags,
234 FSOpenCompletionFunc *cb, void *opaque)

Callers

nothing calls this directly

Calls 3

errno_to_p9Function · 0.85
stat_to_qidFunction · 0.85
compose_pathFunction · 0.70

Tested by

no test coverage detected