-#ifndef ROS_KERN_SYSCALL_H
-#define ROS_KERN_SYSCALL_H
+#pragma once
#ifndef ROS_KERNEL
# error "This is ROS kernel header; user programs should not #include it"
#endif
#include <ros/common.h>
#include <process.h>
+#include <kref.h>
+#include <ns.h>
#define SYSTRACE_ON 0x01
#define SYSTRACE_LOUD 0x02
#define SYSTRACE_ALLPROC 0x04
-#define MAX_NUM_TRACED 10
#define MAX_SYSTRACES 1024
#define SYSCALL_STRLEN 128
uint8_t data[SYSTR_RECORD_SZ - sizeof(struct systrace_record_anon)];
};
+struct strace {
+ bool tracing;
+ bool inherit;
+ atomic_t nr_drops;
+ unsigned long appx_nr_sysc;
+ struct kref procs; /* when procs goes to zero, q is hung up. */
+ struct kref users; /* when users goes to zero, q and struct are freed. */
+ struct queue *q;
+};
+
/* Syscall table */
typedef intreg_t (*syscall_t)(struct proc *, uintreg_t, uintreg_t, uintreg_t,
uintreg_t, uintreg_t, uintreg_t);
void set_errno(int errno);
int get_errno(void);
void unset_errno(void);
-void set_errstr(char *errstr, ...);
+void vset_errstr(const char *fmt, va_list ap);
+void set_errstr(const char *errstr, ...);
char *current_errstr(void);
+void set_error(int error, const char *fmt, ...);
struct errbuf *get_cur_errbuf(void);
void set_cur_errbuf(struct errbuf *ebuf);
char *get_cur_genbuf(void);
/* Utility */
bool syscall_uses_fd(struct syscall *sysc, int fd);
void print_sysc(struct proc *p, struct syscall *sysc);
-
-#endif /* !ROS_KERN_SYSCALL_H */