-#ifndef ROS_INC_ELF_H
-#define ROS_INC_ELF_H
+#pragma once
#include <process.h>
#include <ros/common.h>
# error I know not my endianness!
#endif
+#define ELF_PROT_READ 0x04
+#define ELF_PROT_WRITE 0x02
+#define ELF_PROT_EXEC 0x01
+
typedef struct Elf32 {
uint32_t e_magic; // must equal ELF_MAGIC
uint8_t e_ident[12];
#define ELF_HWCAP_SPARC_FLUSH 1
struct file;
-int load_elf(struct proc* p, struct file* f);
-
-#endif /* !ROS_INC_ELF_H */
+bool is_valid_elf(struct file *f);
+int load_elf(struct proc* p, struct file* f,
+ int argc, char *argv[], int envc, char *envp[]);
+ssize_t get_startup_argc(struct proc *p);
+char *get_startup_argv(struct proc *p, size_t idx, char *argp,
+ size_t max_size);