927
928
929
930
931
932
933
934
935
936
937
938
939
940
|
reboot_ret = reboot(cmd);
if (reboot_ret != 0) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(strerror(errno), -1));
return(TCL_ERROR);
}
return(TCL_OK);
}
static int tuapi_eject(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
Tcl_SetObjResult(interp, Tcl_NewStringObj("not implemented", -1));
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
|
reboot_ret = reboot(cmd);
if (reboot_ret != 0) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(strerror(errno), -1));
return(TCL_ERROR);
}
return(TCL_OK);
}
static int tuapi_set_thread_name(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
char *name;
if (objc == 2) {
#ifdef PR_SET_NAME
name = Tcl_GetString(objv[1]);
prctl(PR_SET_NAME, (unsigned long) name, 0, 0, 0);
#else
Tcl_SetObjResult(interp, Tcl_NewStringObj("unsupported", -1));
return(TCL_ERROR);
#endif
} else {
#ifdef PR_GET_NAME
name = malloc(17);
prctl(PR_GET_NAME, (unsigned long) name, 0, 0, 0);
Tcl_SetObjResult(interp, Tcl_NewStringObj(name, -1));
free(name);
#else
Tcl_SetObjResult(interp, Tcl_NewStringObj("unsupported", -1));
return(TCL_ERROR);
#endif
}
return(TCL_OK);
}
static int tuapi_eject(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
Tcl_SetObjResult(interp, Tcl_NewStringObj("not implemented", -1));
|
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
|
Tcl_CreateObjCommand(interp, "::tuapi::syscall::pivot_root", tuapi_pivot_root, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tuapi::syscall::kill", tuapi_kill, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tuapi::syscall::waitpid", tuapi_waitpid, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tuapi::syscall::ps", tuapi_ps, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tuapi::syscall::execve", tuapi_execve, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tuapi::syscall::rlimit", tuapi_rlimit, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tuapi::syscall::reboot", tuapi_reboot, NULL, NULL);
/* Network related commands */
Tcl_CreateObjCommand(interp, "::tuapi::syscall::ifconfig", tuapi_ifconfig, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tuapi::syscall::route", tuapi_route, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tuapi::syscall::brctl", tuapi_brctl, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tuapi::syscall::vconfig", tuapi_vconfig, NULL, NULL);
|
>
|
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
|
Tcl_CreateObjCommand(interp, "::tuapi::syscall::pivot_root", tuapi_pivot_root, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tuapi::syscall::kill", tuapi_kill, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tuapi::syscall::waitpid", tuapi_waitpid, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tuapi::syscall::ps", tuapi_ps, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tuapi::syscall::execve", tuapi_execve, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tuapi::syscall::rlimit", tuapi_rlimit, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tuapi::syscall::reboot", tuapi_reboot, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tuapi::syscall::set_thread_name", tuapi_set_thread_name, NULL, NULL);
/* Network related commands */
Tcl_CreateObjCommand(interp, "::tuapi::syscall::ifconfig", tuapi_ifconfig, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tuapi::syscall::route", tuapi_route, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tuapi::syscall::brctl", tuapi_brctl, NULL, NULL);
Tcl_CreateObjCommand(interp, "::tuapi::syscall::vconfig", tuapi_vconfig, NULL, NULL);
|