linux/arch/um/drivers/harddog_user.c
<<
>2v4./spalue v4./formue v4.a >2v4 href="../linux+v/00.3/arch/um/drivers/harddog_user.c"> >2v4.img src="../.static/gfx/right.png" alt=">>"> ./spalue .spal class="lxr_search"> >2 >2v4.input typ3.2hidden" nam3.2navtarget" pt2 3.2"> >2v4.input typ3.2text" nam3.2search" id.2search"> >2v4.buttSearch2v4 onclick="return ajax_prefs();"> >2v4Prefse v4./a> ./spalue>2v4 4./divue>2v4 4.form ac val="ajax+*" method="post" onsubmit="return false;"> .input typ3.2hidden" nam3.2ajax_lookup" id.2ajax_lookup" pt2 3.2"> >2v4 4./formue >2v4 4.div class="headingbott2v42v4 v4 4.div id.2search_results" class="search_results"e vue>2v4 4./divue .div id.2content">e .div id.2file_contents"u
4 41./a>.spal class="comment">/*./spalue4 42./a>.spal class="comment"> * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)./spalue4 43./a>.spal class="comment"> * Licensed under the GPL./spalue4 44./a>.spal class="comment"> */./spalue4 45./a> 4 46./a>#include <stdio.h./a>> 4 47./a>#include <unistd.h./a>> 4 48./a>#include <errno.h./a>> 4 49./a>#include "os.h./a>" 4 tiona> 4 11./a>struct4.a href="+code=dog_data" class="sref">dog_data./a> { 4 12./a>        int4.a href="+code=stdin" class="sref">stdin./a>; 4 13./a>        int4.a href="+code=stdout" class="sref">stdout./a>; 4 14./a>        int4.a href="+code=close_me" class="sref">close_me./a>[2]; 4 15./a>}; 4 16ona> 4 17./a>static void4.a href="+code=pre_exec" class="sref">pre_exec./a>(void4*.a href="+code=d" class="sref">d./a>) 4 18./a>{ 4 19./a>        struct4.a href="+code=dog_data" class="sref">dog_data./a> *.a href="+code=data" class="sref">data./a> =4.a href="+code=d" class="sref">d./a>; 4 2iona> 4 21./a>        .a href="+code=dup2" class="sref">dup2./a>(.a href="+code=data" class="sref">data./a>->.a href="+code=stdin" class="sref">stdin./a>, 0); 4 22./a>        .a href="+code=dup2" class="sref">dup2./a>(.a href="+code=data" class="sref">data./a>->.a href="+code=stdout" class="sref">stdout./a>, 1); 4 23./a>        .a href="+code=dup2" class="sref">dup2./a>(.a href="+code=data" class="sref">data./a>->.a href="+code=stdout" class="sref">stdout./a>, 2); 4 24./a>        .a href="+code=close" class="sref">close./a>(.a href="+code=data" class="sref">data./a>->.a href="+code=stdin" class="sref">stdin./a>); 4 25./a>        .a href="+code=close" class="sref">close./a>(.a href="+code=data" class="sref">data./a>->.a href="+code=stdout" class="sref">stdout./a>); 4 26./a>        .a href="+code=close" class="sref">close./a>(.a href="+code=data" class="sref">data./a>->.a href="+code=close_me" class="sref">close_me./a>[0]); 4 27./a>        .a href="+code=close" class="sref">close./a>(.a href="+code=data" class="sref">data./a>->.a href="+code=close_me" class="sref">close_me./a>[1]); 4 28./a>} 4 29ona> 4 3iona>int4.a href="+code=start_watchdog" class="sref">start_watchdog./a>(int4*.a href="+code=in_fd_ret" class="sref">in_fd_ret./a>, int4*.a href="+code=out_fd_ret" class="sref">out_fd_ret./a>, char4*.a href="+code=sock" class="sref">sock./a>) 4 31./a>{ 4 32./a>        struct4.a href="+code=dog_data" class="sref">dog_data./a> .a href="+code=data" class="sref">data./a>; 4 34./a>{d116n2
	  >
  v4.4iona>int4.a href="+code=start_watchdog" cl; int4.a hreret./aode=start_watchdret./ao; int4.a hrepis="sref">d./a>; pishar4*.iona>int4.a hres="sref">stdin./nhar4*.iona>int4.a hreerr="sref">stdin./erra href="arch/um/drivers/harddog_user.c#L33" id.2L24" cla3s="line" nam3.2L24">4 23./a> 3      .a hrefa hreiona>int4.a hrepis_buf="sref">d./a>; pis_buf; int4.a hres="sref">pre_execa href="arch/um/drivers/harddog_user.c#L33" id.2L25" cla3s="line" nam3.2L25">4 23./a> 35     .a hrefa href="+code=sock" cpis_argode=start_watchdpis_argo; (ina href=int4.a hrepis_buf="sref">d./a>; pis_buf; int4.a hreNULL="sref">d./a>; NULL     ref="arch/um/drivers/harddog_user.c#L16" id.3L26" cla3s="line" nam3.2L26">4 23./a> 36     .a hrefa href="+code=sock" cmconsole_argode=start_watchdmconsole_argo; (ina href=int4.a hreNULL="sref">d./a>; NULL    ,f="arch/um/drivers/harddog_user.c#L16" id.3L27" cla3s="line" nam3.2L27">4 23./a> 3      .a hreffffffffffffffffffffffffffflona>int4.a hreNULL="sref">d./a>; NULL     ref="arch/um/drivers/harddog_user.c#L16" id.3L28" cla3s="line" nam3.2L28">4 23./a>}38     .a hrefa hreff="+code=sock" cargode=start_watchdargo; d./a>; NULL    ef="arch/um/drivers/harddog_user.c#L16" id.3L29" cla3s="line" nam3.2L29">4 23ona> 3a href="arch/um/drivers/harddog_user.c#L30" id.4L30" cla4s="line" nam3.2L30">4 34ona>i40     .a href="+code=close" err="sref">stdin./erra hrref="+code=d" clasos_pips="sref">close_mos_pips href="+code=data" cf="+code=start_watchdog" cl; 4 34./a>{4      .a hrefif f="+code=data" cerr="sref">stdin./erra hrrhref hrref="arch/um/drivers/harddog_user.c#L12" id.4L32" cla4s="line" nam3.2L32">4 34./a> 42     .a hrefffffffff="+code=pre_exec"v4.s="sref">sock./ac"v4.s href=ass="comment.a ing" stdin./erra hrref="arch/um/drivers/harddog_user.c#L22" id.4L33" cla4s="line" nam3.2L33">4 34./a>{43     .a hrefffffffffgoto4iona>int4.a hreretde=start_watchdret    ef="arch/um/drivers/harddog_user.c#L16" id.4L4" classs="line" nam3.2L4">4 44../a> 4      .a hrefef="arch/um/drivers/harddog_user.c#L29" id.4L25" cla4s="line" nam3.2L25">4 24./a> 4a href="arch/um/drivers/harddog_user.c#L6" id.24L26" cla4s="line" nam3.2L26">4 24./a> 4      .a href="+code=close" err="sref">stdin./erra hrref="+code=d" clasos_pips="sref">close_mos_pips href="+code=data" cret./aode=start_watchdret./ao; 4 24./a> 47     .a hrefif f="+code=data" cerr="sref">stdin./erra hrrhref hrref="arch/um/drivers/harddog_user.c#L12" id.4L28" cla4s="line" nam3.2L28">4 24./a>}48     .a hrefffffffff="+code=pre_exec"v4.s="sref">sock./ac"v4.s href=ass="comment.a ing" stdin./erra hrref="arch/um/drivers/harddog_user.c#L22" id.4L29" cla4s="line" nam3.2L29">4 24ona> 49     .a hrefffffffffgoto4iona>int4.a hreret_e./a>[ss="sref">stdin./ret_e./a>[ss    ef="arch/um/drivers/harddog_user.c#L16" id.5L30" cla5s="line" nam3.2L30">4 35ona>i50harddog_user.c#L29" id.4L25" cla4s="line" nam3.2L25">4 5L31" cla5s="line" nam3.2L31">4 343/a>{451href="arch/um/drivers/harddog_user.c#L6" id.24532" cla45="line" nam3.2L32">4 345/a> 45     .a href="+code=dup2" class="sref">data./a>; stdin./a>); 4 345/a>{45     .a href="+code=dup2" class="sref">data./a>; stdout./a>); 4 44.5/a> 45     .a href="+code=close" cass="sref">data./a>; close_me./a>[0]); 4 45.//a> 45     .a href="+code=close" cass="sref">data./a>; close_me./a>[0]); 4 245/a> 45 href="arch/um/drivers/harddog_user.c#L17" id.2527" cla45="line" nam3.2L27">4 245/a> 45     .a hrefif f="+code=data" ceass="sref">sock./a>) d./a>; NULL    eref="arch/um/drivers/harddog_user.c#L12" id.4528" cla45="line" nam3.2L28">4 245/a>}45     .a hrefffffffff="+code=pre_execconsole_argode=start_watchdmconsole_argo; sock./a>) 4 245na> 45     .a hrefffffffffg"+code=sock" cargode=start_watchdargo; 4 356na>i56harddog_user.c#L29" id.4L25" cla4s="line" nam3.2L25">4 5631" cla56="line" nam3.2L31">4 346/a>{46     .a hrefielseef="arch/um/drivers/harddog_user.c#L12" id.4632" cla46="line" nam3.2L32">4 346/a> 46     .a hrefffffffff="ss="comment">/*./spalue XXX Theos_pgetpid() is not SMP correctlue4 346/a>{46     .a hrefffffffffg"+code=d" clasoa"v4.s="sref">d./a>; pa"v4.s=href="+code=data" cris_buf="sref">d./a>; pis_buf; int4.a hreNs_pgetpid"sref">close_mos_pgetpidhref=)ef="arch/um/drivers/harddog_user.c#L22" id.464" class6="line" nam3.2L4">4 44.6/a> 464    .a hrefffffffffg"+code=sock" cargode=start_watchdargo; 4 45.6/a> 465arddog_user.c#L29" id.4L25" cla4s="line" nam3.2L25">4 566" class=="line" nam3.2L6">4 46.//a> 46 href="arch/um/drivers/harddog_user.c#L17" id.2627" cla46="line" nam3.2L27">4 246/a> 46     .a href="+code=close" cis="sref">d./a>; pishar4*ef="+code=d" clasNrun_helpe="sref">stdin./erun_helpe=href="+code=data" cri class="sref">pre_exec./a>(void4*., &="+code=close_meass="sref">data./a>; int4.a hreNrgode=start_watchdargo; 4 246/a>}468href="arch/um/drivers/harddog_user.c#L17" id.2629" cla46="line" nam3.2L29">4 246na> 469    .a href="+code=close" class="sref">close./a>(.a href="+code=data" clst./aode=start_watchdret./ao; 4 357na>i57     .a href="+code=close" elass="sref">close./a>(.a href="+code=data" cl="+code=start_watchdog" cl; 4 347/a>{471href="arch/um/drivers/harddog_user.c#L6" id.24732" cla47="line" nam3.2L32">4 347/a> 47     int4.a hr f="+code=data" ceis="sref">d./a>; pishar4*eref hrref="arch/um/drivers/harddog_user.c#L12" id.4733" cla47="line" nam3.2L33">4 347/a>{47     .a hrefffffffffg"+code=d" clasorr="sref">stdin./erra hrref=="+code=data" ceis="sref">d./a>; pishar4*f="arch/um/drivers/harddog_user.c#L22" id.474" class7="line" nam3.2L4">4 44.7/a> 474    .a hrefffffffffg"+code=sock" ca"v4.s="sref">sock./ac"v4.s href=ass="comment.a ing" stdin./erra hrref="arch/um/drivers/harddog_user.c#L22" id.475" class7="line" nam3.2L5">4 45.7/a> 475    .a hrefffffffffgoto4iona>int4.a hreret_e./a>[setde=start_watchdret e./a>[setdar4*f="arch/um/drivers/harddog_user.c#L22" id.476" class7="line" nam3.2L6">4 46.7/a> 476arddog_user.c#L29" id.4L25" cla4s="line" nam3.2L25">4 577" class=="line" nam3.2L7">4 47.//a> 477href="arch/um/drivers/harddog_user.c#L6" id.24728" cla47="line" nam3.2L28">4 247/a>}478    .a href="+code=close" e="sref">stdin./nhar4*ef="+code=d" clasNrea="sref">d./a>; prea=href="+code=data" cl="+code=start_watchdog" cl; pre_execa hre, izeof(la+code=close_me="sref">pre_execa hre)ef="arch/um/drivers/harddog_user.c#L22" id.4729" cla47="line" nam3.2L29">4 247na> 479    int4.a hr f="+code=data" ce="sref">stdin./nhar4*ef=hrref="arch/um/drivers/harddog_user.c#L12" id.4830" cla58="line" nam3.2L30">4 358na>i580    .a hrefffffffffg"+code=sock" ca"v4.s="sref">sock./ac"v4.s href=ass="comment.a ing" (ina ips na href=4 348/a>{481    .a hrefffffffffg"+code=sock" cahelpe=_waide=start_watchdrhelpe=_waidhref="+code=data" cris_"sref">d./a>; pishar4*ef="arch/um/drivers/harddog_user.c#L22" id.4832" cla48="line" nam3.2L32">4 348/a> 48     .a hrefffffffff="+code=pre_execrr="sref">stdin./erra hrref=="+code=data" ceEIO"sref">stdin./eEIOar4*f="arch/um/drivers/harddog_user.c#L22" id.4833" cla48="line" nam3.2L33">4 348/a>{48     .a hrefffffffffgoto4iona>int4.a hreretde./a>[setde=start_watchdret e./a>[setdar4*f="arch/um/drivers/harddog_user.c#L22" id.484" class8="line" nam3.2L4">4 44.8/a> 48     .a hrefef="arch/um/drivers/harddog_user.c#L29" id.485" class8="line" nam3.2L5">4 45.8/a> 485    .a hreffelseer f="+code=data" ce="sref">stdin./nhar4*eref hrref="arch/um/drivers/harddog_user.c#L12" id.486" class8="line" nam3.2L6">4 46.8/a> 486    .a hrefffffffffg"+code=sock" ca"v4.s="sref">sock./ac"v4.s href=ass="comment.a ing" (ina ips failed, e href=4 47.8/a> 48     .a hrefffffffffffffffffass="comment.a ing" stdin./erranoar4*ef="arch/um/drivers/harddog_user.c#L22" id.488" class=="line" nam3.2L8">4 48.//a>}48     .a hrefffffffff="+code=pre_exechelpe=_waide=start_watchdrhelpe=_waidhref="+code=data" cris_"sref">d./a>; pishar4*ef="arch/um/drivers/harddog_user.c#L22" id.4829" cla48="line" nam3.2L29">4 248na> 48     .a hrefffffffffg"+code=sock" carr="sref">stdin./erra hrref="+code=d" claso="sref">stdin./nhar4*f="arch/um/drivers/harddog_user.c#L9" id.2L930" cla59="line" nam3.2L30">4 359na>i590    .a hrefffffffffgoto4iona>int4.a hreretde./a>[setde=start_watchdret e./a>[setdar4*f="arch/um/drivers/harddog_user.c#L22" id.4931" cla59="line" nam3.2L31">4 349/a>{491    .a hrefef="arch/um/drivers/harddog_user.c#L29" id.4932" cla49="line" nam3.2L32">4 349/a> 49     .a hreff="+code=in_fd_ret" class="sref">in_fd_ret./a>, int4*.ef="+code=d" claso="+code=start_watchdog" cl; 4 349/a>{493    .a hreff="+code=in_fd_reet" class="sref">out_fd_ret./a>, char4*ef="+code=d" clasost./aode=start_watchdret./ao; 4 44.9/a> 49     .a hrefealse;">0f="arch/um/drivers/harddog_user.c#L15" id.295" class9="line" nam3.2L5">4 45.9/a> 49 href="arch/um/drivers/harddog_user.c#L6" id.2496" class9="line" nam3.2L6">4 46.9/a> 496    .ona>int4.a hreret_e./a>[ss="sref">stdin./ret_e./a>[ss    e:="arch/um/drivers/harddog_user.c#L6" id.2497" class9="line" nam3.2L7">4 47.9/a> 49     .a href="+code=close" class="sref">close./a>(.a href="+code=data" cl="+code=start_watchdog" cl; 4 48.9/a>}498    .a href="+code=close" elass="sref">close./a>(.a href="+code=data" cl="+code=start_watchdog" cl; 4 49./na> 499    .ona>int4.a hreret_e./a>[setde=start_watchdret e./a>[setdar4*:="arch/um/drivers/harddog_user.c#L6" id.241010" class=="line" nam3.2L10">4 tionna>ionn    .a href="+code=close" class="sref">close./a>(.a href="+code=data" clst./aode=start_watchdret./ao; 4 11.01a>ion     .a href="+code=dup2" cllass="sref">close./a>(.a href="+code=data" clst./aode=start_watchdret./ao; 4 12.02a>ion2    .ona>int4.a hreret_e=start_watchdret.ar4*:="arch/um/drivers/harddog_user.c#L6" id.241013" class0="line" nam3.2L13">4 13.03a>ion3    .a hrefealse;">"+code=sock" carr="sref">stdin./erra hrrf="arch/um/drivers/harddog_user.c#L22" id.41014" class0="line" nam3.2L14">4 14.04a>ion     f="arch/um/drivers/harddog_user.c#L29" id.41015" class0="line" nam3.2L15">4 15.05a>ion href="arch/um/drivers/harddog_user.c#L6" id.241016" class0="line" nam3.2L16">4 16o06a>ion6    href="+code=pre_execstopg" class="sref">start_watcopg" class=href=4.4iona>int4.a href="+coe=start_watchdog" cl hre, 4.4iona>int4.a hrefet./aoe=start_watchdret./aoar4*e="arch/um/drivers/harddog_user.c#L6" id.241017" class0="line" nam3.2L17">4 17.07a>ion     f="arch/um/drivers/harddog_user.c#L19" id.2L018" class0="line" nam3.2L18">4 18.08a>ion8    .a href="+code=close" elass="sref">close./a>(.a href="+code=data" cl="+coe=start_watchdog" cl hreef="arch/um/drivers/harddog_user.c#L22" id.41019" class0="line" nam3.2L19">4 19.09a>ion9    .a href="+code=close" class="sref">close./a>(.a href="+code=data" clst./aoe=start_watchdret./aoar4*ef="arch/um/drivers/harddog_user.c#L22" id.41L10" classs="line" nam3.2L10">4 tioona> 1a hreff="arch/um/drivers/harddog_user.c#L29" id.41L11" class=="line" nam3.2L11">4 11./1a>io11href="arch/um/drivers/harddog_user.c#L6" id.241L12" classs="line" nam3.2L12">4 12../a> 1      4.4iona>int4.a hrefpng"g" class="sref">start_wapng"g" class=href=4.4iona>int4.a hrefaoe=start_watchdraoar4*e="arch/um/drivers/harddog_user.c#L6" id.241L13" classs="line" nam3.2L13">4 13../a> 1      f="arch/um/drivers/harddog_user.c#L19" id.2LL14" classs="line" nam3.2L14">4 14../a> 1      int4.a href="+code=close_me="sref">stdin./nhar4*f="arch/um/drivers/harddog_user.c#L9" id.2L1L15" classs="line" nam3.2L15">4 15../a>}11     .a hrefa hrefa+code=close_me="sref">pre_execa hreef="ss="comment.a ing" 4 16oona> 1a href="arch/um/drivers/harddog_user.c#L17" id.2LL17" classs="line" nam3.2L17">4 17../a>s11     .a href="+code=close" c="sref">stdin./nhar4*ef="+code=d" clasNwrit="sref">close./awrit=href="+code=data" claoe=start_watchdraoar4*, &="+code=close_me="sref">pre_execa hre, izeof(la+code=close_me="sref">pre_execa hre)ef="arch/um/drivers/harddog_user.c#L22" id.41L18" classs="line" nam3.2L18">4 18../a>{118    .a href=r f="+code=data" ce="sref">stdin./nhar4*e!= izeof(la+code=close_me="sref">pre_execa hre)eef="arch/um/drivers/harddog_user.c#L12" id.2LL19" classs="line" nam3.2L19">4 19../a> 11     .a hrefffffffffg"+code=sock" ca"v4.s="sref">sock./ac"v4.s href=ass="comment.a ing" 4 2i1ona> 120    .a hrefffffffffga href="+code=close" c="sref">stdin./nhar4* -"+code=pre_execrr=no"sref">stdin./erranoar4*ef="arch/um/drivers/harddog_user.c#L22" id.41L21" clas1s="line" nam3.2L21">4 211./a> 121    .a hrefffffffffgr f="+code=data" ce="sref">stdin./nhar4*eref hrr="arch/um/drivers/harddog_user.c#L22" id.41L12" class=="line" nam3.2L12">4 12.//a> 12     .a hrefffffffff=.a hrefealse;">"+code=sock" ca="sref">stdin./nhar4*f="arch/um/drivers/harddog_user.c#L9" id.2L1L23" clas1s="line" nam3.2L23">4 231./a> 12     .a hrefffffffffgalse;">="+code=data" ceEIO"sref">stdin./eEIOar4*f="arch/um/drivers/harddog_user.c#L22" id.41L24" clas1s="line" nam3.2L24">4 241./a> 12     .a hrefef="arch/um/drivers/harddog_user.c#L29" id.41L25" clas1s="line" nam3.2L25">4 251./a> 1      .a href=alse;">1f="arch/um/drivers/harddog_user.c#L22" id.41L16" classs="line" nam3.2L26">4 261./a> 12 href="arch/um/drivers/harddog_user.c#L17" id.2LL27" clas1s="line" nam3.2L27">4 271./a> 1      f="arch/um/drivers/harddog_user.c#L29" id.41L18" classs="line" nam3.2L28">4 281./a>}12v4
Theosriginal LXR software by./spa"arch/um/http://sourceforge.net/projects/lxr">LXR >/*.unityar4* -  >2 experi./spal ddog3.22by."arch/um/mileto:lxr@tel}.cno">lxr@tel}.cnoar4*.
.div id2contine" nasubfooter">
lxr.tel}.cno kindly hosted2by."arch/um/http://www.redpill-telprocno">Redpill Lelpro ASar4* -proviGPL.of Lelux onsoultng" and operaax+*s 9" vices 9ince 1995.
.div id.2/bodyid2/htmldi