Check-in [20d82b1585]
Overview
Comment:Implemented "rmmod"
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 20d82b1585e898bcae6227bb4d420e1d727e3dec
User & Date: rkeene on 2015-05-17 04:16:41
Other Links: manifest | tags
Context
2016-03-30
03:04
Added ifdef around CAN, needed for RHEL5 check-in: 49fcda9f97 user: rkeene tags: trunk
2015-05-17
04:16
Implemented "rmmod" check-in: 20d82b1585 user: rkeene tags: trunk
2015-04-07
17:36
Added more functionality to the "reboot" syscall wrapper check-in: f7f4d0aee8 user: rkeene tags: trunk
Changes

Modified tuapi.c from [197b72911d] to [a8bc74d0c2].

79
80
81
82
83
84
85





86
87
88
89
90
91
92
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








>
>
>
>
>







79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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

504
505
506
507
508
509
510





511
512
513














514
515
516
517
518
519
520
		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);
}







>
>
>
>
>
|

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







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
		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);
}