Diff

Differences From Artifact [197b72911d]:

To Artifact [a8bc74d0c2]:


79
80
81
82
83
84
85





86
87
88
89
90
91
92
...
504
505
506
507
508
509
510





511
512
513














514
515
516
517
518
519
520
extern char **environ;

/* Re-implement these if needed */
#ifdef SYS_init_module
static int init_module(void *val, unsigned long len, const char *args) {
	return(syscall(SYS_init_module, val, len, args));
}





#endif
#ifdef SYS_pivot_root
static int pivot_root(const char *new_root, const char *put_old) {
	return(syscall(SYS_pivot_root, new_root, put_old));
}
#endif

................................................................................
		return(TCL_ERROR);
	}

	return(TCL_OK);
}

static int tuapi_rmmod(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {





	Tcl_SetObjResult(interp, Tcl_NewStringObj("not implemented", -1));

	return(TCL_ERROR);














}

static int tuapi_lsmod(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
	Tcl_SetObjResult(interp, Tcl_NewStringObj("not implemented", -1));

	return(TCL_ERROR);
}







>
>
>
>
>







 







>
>
>
>
>
|

|
>
>
>
>
>
>
>
>
>
>
>
>
>
>







79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
...
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
extern char **environ;

/* Re-implement these if needed */
#ifdef SYS_init_module
static int init_module(void *val, unsigned long len, const char *args) {
	return(syscall(SYS_init_module, val, len, args));
}
#endif
#ifdef SYS_delete_module
static int delete_module(const char *name, int flags) {
	return(syscall(SYS_delete_module, name, flags));
}
#endif
#ifdef SYS_pivot_root
static int pivot_root(const char *new_root, const char *put_old) {
	return(syscall(SYS_pivot_root, new_root, put_old));
}
#endif

................................................................................
		return(TCL_ERROR);
	}

	return(TCL_OK);
}

static int tuapi_rmmod(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
	char *module;
	int idx;
	int delete_module_ret;

	if (objc < 2) {
		Tcl_SetObjResult(interp, Tcl_NewStringObj("wrong # args: should be \"tuapi::syscall::rmmod module ?module...?", -1));

		return(TCL_ERROR);
	}

	for (idx = 1; idx < objc; idx++) {
		module = Tcl_GetString(objv[idx]);

		delete_module_ret = delete_module(module, O_NONBLOCK);
		if (delete_module_ret != 0) {
			Tcl_SetObjResult(interp, Tcl_ObjPrintf("unable to remove \"%s\": %s", module, strerror(errno)));

			return(TCL_ERROR);
		}
	}

	return(TCL_OK);
}

static int tuapi_lsmod(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
	Tcl_SetObjResult(interp, Tcl_NewStringObj("not implemented", -1));

	return(TCL_ERROR);
}