Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle fstat for stdin and stderr, stage make rule for use with nvm #219

Merged
merged 2 commits into from
Nov 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ image: mkfs boot stage3 target
@ mkdir -p $(dir $(IMAGE))
$(Q) $(MKFS) $(FS) < examples/$(TARGET).manifest && cat $(BOOTIMG) $(FS) > $(IMAGE)

stage: image
- mkdir .staging
- cp -a output/boot/boot.img .staging/boot.img
- cp -a output/stage3/stage3.img .staging/stage3.img

contgen: $(CONTGEN)

mkfs: mkfs-build
Expand Down
1 change: 1 addition & 0 deletions src/runtime/table.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ static inline key position(int buckets, key x)
void *table_find (table z, void *c)
{
table t = valueof(z);
assert(t);
key k = t->key_function(c);
for (entry i = t->entries[position(t->buckets, k)]; i; i = i->next){
if ((i->k == k) && t->equals_function(i->c, c))
Expand Down
6 changes: 3 additions & 3 deletions src/unix/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ char *syscall_name(int x)
if (syscall_codes[i].c == x)
return syscall_codes[i].n;
}
return ("invalidine syscall");
return ("invalid syscall");
}

sysreturn read(int fd, u8 *dest, bytes length)
Expand Down Expand Up @@ -647,7 +647,6 @@ sysreturn openat(int dirfd, char *name, int flags, int mode)

static void fill_stat(tuple n, struct stat *s)
{
zero(s, sizeof(struct stat));
s->st_dev = 0;
s->st_ino = u64_from_pointer(n);
if (table_find(n, sym(children))) {
Expand All @@ -669,8 +668,9 @@ static sysreturn fstat(int fd, struct stat *s)
{
thread_log(current, "fd %d, stat %p\n", fd, s);
file f = resolve_fd(current->p, fd);
zero(s, sizeof(struct stat));
// take this from tuple space
if (fd == 1) {
if (fd == 0 || fd == 1 || fd == 2) {
s->st_mode = S_IFIFO;
return 0;
}
Expand Down