Senza categoria

call_usermodehelper 예제

프린트크(KERN_DEBUG”테스트드라이버1_이니텍스! call_usermodehelper의 결과는 %dn”,결과입니다); 인터럽트 처리기(예: 기다릴 수 없는 컨텍스트)에서 call_usermodehelper를 사용하려는 경우 UMH_NO_WAIT를 인수로 전달할 수 있습니다. 377/** 378 * call_usermodehelper_exec – 사용자 모드 응용 프로그램 시작 379 * @sub_info: 하위 프로세스에 대한 정보 380 * @wait : 응용 프로그램이 완료및 반환 상태를 기다립니다. 381 * -1이 전혀 기다리지 않지만 382 * 프로그램이 exec`ed 일 수 없을 때 유용한 오류가 다시 발생합니다. 이렇게 하면 인터럽트 컨텍스트에서 383 * 호출해도 안전합니다. -1 (주)에 의한 이면에 1) 384 * 385 * 사용자 공간 응용 프로그램을 실행합니다. 대기가 설정되지 않은 경우 응용 프로그램은 386 * 비동기적으로 시작되고 keventd의 자식으로 실행됩니다. 387 * (즉, 그것은 전체 루트 기능으로 실행).call_usermodehelper_exec,,,에의 한, (주)에이치오성한,,,,,,,,에의 의아해는, 뿌리가 있는。 。 388 */ 389int call_usermodehelper_exec(구조체 하위 프로세스_info *sub_info, 390 열거형 umh_wait 대기) 391{ 392 DECLARE_COMPLETION_ONSTACK (완료); 393 int retval = 0; 394 395 도우미_lock (); 396 경우 (sub_info->path[0] == “) 397 goto out; 398 399 if (!khelper_wq usermodehelper_disabled) { 400 retval = -EBUSY; 401 goto out; 402 } 403 404 sub_info->complete = & 405 sub_info->wait = 대기; 406 407 queue_work(khelper_wq, 및 sub_info->작업); 408 (대기 == UMH_NO_WAIT) /* 작업이 sub_info */ 409 goto 잠금 해제를 해제했습니다. (주)에 이은, 잠을 자고 있습니다。 410 wait_for_completion(완료); 411 retval = sub_info->retval; 412 413out: 414 call_usermodehelper_freeinfo(sub_info); 415unlock: 416 도우미_unlock(); 417 리턴 리탈; 418} 419EXPORT_SYMBOL(call_usermodehelper_exec); 420 421void __init usermodehelper_init(보이드) 422{ 423 khelper_wq = create_singlethread_workqueue(“khelper”); 424 BUG_ON(!khelp er_wq); 425} 리눅스, 리눅스, 콜_유저모드도우미()-사용자모드도우미()는 장우1241번 호출하려면 인터럽트 핸들러 내에서 call_usermodehelper()를 호출하고 있습니까? 나는 call_usermodehelper() 기다릴 수있는 컨텍스트에서 호출되어야한다고 생각합니다.

Founder e direttore di "Perdersi a Roma" ha pubblicato libri di prose, poesie e narrativa di viaggio tra cui "Le persone" (Kolibris) e "Letti" (Voland).