#endif
#include <linux/module.h>
#include <linux/kernel.h>
+#include <linux/fs_struct.h>
#include <linux/sched.h>
#include <libcfs/libcfs.h>
void cfs_enter_debugger(void)
{
#if defined(CONFIG_KGDB)
- BREAKPOINT();
+// BREAKPOINT();
#elif defined(__arch_um__)
asm("int $3");
#else
unsigned long flags;
lock_kernel();
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,63))
daemonize(str);
-#else
- daemonize();
- exit_files(current);
- reparent_to_init();
- snprintf (current->comm, sizeof (current->comm), "%s", str);
-#endif
SIGNAL_MASK_LOCK(current, flags);
sigfillset(¤t->blocked);
RECALC_SIGPENDING;
}
int cfs_daemonize_ctxt(char *str) {
- struct task_struct *tsk = current;
- struct fs_struct *fs = NULL;
cfs_daemonize(str);
+#ifndef HAVE_UNSHARE_FS_STRUCT
+ {
+ struct task_struct *tsk = current;
+ struct fs_struct *fs = NULL;
fs = copy_fs_struct(tsk->fs);
if (fs == NULL)
return -ENOMEM;
exit_fs(tsk);
tsk->fs = fs;
+ }
+#else
+ unshare_fs_struct();
+#endif
return 0;
}
-
sigset_t
cfs_get_blockedsigs(void)
{
EXPORT_SYMBOL(libcfs_arch_init);
EXPORT_SYMBOL(libcfs_arch_cleanup);
+EXPORT_SYMBOL(cfs_enter_debugger);
EXPORT_SYMBOL(cfs_daemonize);
EXPORT_SYMBOL(cfs_daemonize_ctxt);
EXPORT_SYMBOL(cfs_block_allsigs);