📄 mandlock.c
字号:
// <![CDATA[
// Begin Ad Muncher helper script
// Do not remove without removing all references to this in the below page (eg: everything containing "xyw" or "xyb")
// Original URL: http://www.ibm.com/developerworks/cn/linux/l-cn-filelock/mandlock.c
// Retrieved from: 129.42.58.216:80
function xywn(){return false;};
function xywbHelp(a,b){xywxgp(a);xywxbn();return;};
function xywb(a,b,c,d){xywxgp(a);xywxbn();return xywxfw(b);};
function xywxpp(a){xywxppa=a;if(a)xywxorgsti("xywxppa=0;",500);};
function xywbtePopup(a,b,c,d,e,f){xywxgp();xywxbn();return xywxfw();};
function xywbModalDialog(a,b,c){xywxgp(a);xywxbn();return xywxfw();};
function xywxj(m,u,l){if(xywxolp){xywxqn=xywxqnbu;xywxolp=0;};return true;};
function xywbModelessDialog(a,b,c){xywxgp(a);xywxbn();return xywxfw();};
function xywxpl(a,b,c){while(a.indexOf(b)!=-1)a=a.replace(b,c);return a;};
function xywxtry(a,z){if(xywxtryk())eval("try{"+a+"}catch(e){};");else eval(a);};
function xywc(){xywxqn=xywxqnbu=10;xywxorgsti("xywxqn=xywxqnbu=0;",500);return;};
function xywx__amscript_addonload(a){xywx_ams_onload[xywx_ams_onload_i++]=(typeof(a)=="function")?a:new Function(a);};
function xywx__amscript_addonunload(a){xywx_ams_onunload[xywx_ams_onunload_i++]=(typeof(a)=="function")?a:new Function(a);};
function xywxfcs(z){xywxfcsr=0;if(z){xywxfcsrz=z;xywxtry("xywxfcsr=xywxfcsd();");};return xywxfcsr;};
function xywxfc(a,z){for(var i=0;i<a.length;i++)if(a[i].name==z||xywxfc(a[i].frames,z))return 1;return 0;};
function xyb(z){if(typeof(z.location)!="undefined"||typeof(z.blur)=="undefined")return false;return z.blur();};
function xywf(z){if(typeof(z.location)!="undefined"||typeof(z.focus)=="undefined")return false;return z.focus();};
function xywxHelp(a,b){if(xywxck(a))return;if(xywxqn)xywxqn-=1;if(b)return showHelp(a,b);else return showHelp(a);};
function xywTimeout(a,b){if(((!xywxqn&&!xywxa)||xywxppa||xywxul)&&typeof(a)=="string")return xywxorgsti("xywxpp(1);"+a+";xywxpp(0);",b);return xywxorgsti(a,b);};
function xywInterval(a,b){if(((!xywxqn&&!xywxa)||xywxppa||xywxul)&&typeof(a)=="string")return xywxorgsin("xywxpp(1);"+a+";xywxpp(0);",b);return xywxorgsin(a,b);};
function xywxbn(){if(xywxd&&xywxm){if(xywxb){xywxc="s";xywxb+=", "+xywxm;}else{xywxc="";xywxb=xywxm;};xywxi="Popup"+xywxc+" on page blocked by Ad Muncher: "+xywxb;xywxu();};};
function xywxox(){var x;for(var i=0;i<xywx_ams_onunload.length;i++){if(typeof(xywx_ams_onunload[i])=="function")xywx_ams_onunload[i]();};if(typeof(xywxffad)!="undefined"&&!xywxffadd){if(xywxkou)xywxul=1;xywxffadd=1;if(typeof(xywxffad)=="function")x=xywxffad();else eval(xywxffad);xywxul=0;};return x;};
function xywxModalDialog(a,b,c){if(xywxck(a,b))return xywxfw();if(xywxqn)xywxqn-=1;if(c)return showModalDialog(a,b,c);else if(b)return showModalDialog(a,b);else return showModalDialog(a);};
function xywxs(a){if((typeof(a.target)!="undefined"&&typeof(a.action)!="undefined"&&a.target&&xywxnw(a.target)&&xywxck(a.action))||typeof(a.submit)=="undefined")return false;return a.submit();};
function xywxt(a){if((xywxqn||xywxa)&&!xywxppa&&!xywxul){if(xywxqn)xywxqn-=1;return alert(a);};if(a&&xywxd){xywxi="Alert message blocked by Ad Muncher: "+xywxpl(a,"\n"," ");xywxu();};return false;};
function xywxModelessDialog(a,b,c){if(xywxck(a,b))return xywxfw();if(xywxqn)xywxqn-=1;if(c)return showModelessDialog(a,b,c);else if(b)return showModelessDialog(a,b);else return showModelessDialog(a);};
function xywxsp(a,z){if(a.split)return a.split(z);var j,c,s,n,b,e;j=b=0;c=on.length;s=new Array();a+=z;n=a.length;while(b<n){e=z?a.indexOf(z,b):b+1;s[j++]=a.substring(b,e);b=e+c;};return s.length=j,s;};
function xywxu(a){xywxi=xywxpl(xywxpl(xywxi.substring(0,1024),'"',"<~am~`"),"<~am~`",'\\"');xywxir='defaultStatus="'+xywxi+'";';if(!xywxss){xywxss=1;xywxorgsin("eval(xywxir);",3000);};xywxorgsti("eval(xywxir);",1000);};
function xywxe(){xywxa=0;xywxqnbu=xywxqn;xywxqn=0;xywxolp=1;xywxorgsti("xywxa=1;",1000);if(!xywxffd){xywxffd=1;for(var i=0;i<xywx_ams_onload.length;i++){if(typeof(xywx_ams_onload[i])=="function")xywx_ams_onload[i]();};if(typeof(xywxff)!="undefined"){if(typeof(xywxff)=="function")xywxff();else eval(xywxff);};};xywxqn=xywxqnbu;xywxolp=0;xywxx();};
function xywxnw(a){xywxagt=navigator.userAgent.toLowerCase();if(a!="_self"&&a!="_top"&&a!="_main"&&a!="_parent"&&!xywxfcs(a)&&((xywxagt.indexOf("msie")==-1||xywxagt.indexOf("opera")!=-1)||(a!="_search"&&a!="_media")))return 1;return 0;};
function xywxobx(){var x;if(typeof(xywxffreunload)!="undefined"&&!xywxffreunloadd){if(xywxkou)xywxul=1;xywxffreunloadd=1;if(typeof(xywxffreunload)=="function")x=xywxffreunload();else eval(xywxffreunload);xywxffreunloadd=0;xywxul=0;};return x;};
function xywxtryk(){var b=navigator.userAgent.toLowerCase();var c=parseInt(navigator.appVersion);if((b.indexOf("mozilla")!=-1&&b.indexOf("compatible")== -1&&c>=5)||(b.indexOf("opera")!=-1&&c>=6)||(b.indexOf("msie")!=-1&&c>=4))return 1;return 0;};
function xywxfcsd(){var v=self;if(xywxfc(v.frames,xywxfcsrz)||(typeof(v.name)!="undefined"&&v.name==xywxfcsrz))return 1;while(v!=v.parent){v=v.parent;if(xywxfc(v.frames,xywxfcsrz)||(typeof(v.name)!="undefined"&&v.name==xywxfcsrz))return 1;};return 0;};
function xywxtePopup(a,b,c,d,e,f){if(xywxck())return xywxfw();if(xywxqn)xywxqn-=1;if(f)return createPopup(a,b,c,d,e,f);else if(e)return createPopup(a,b,c,d,e);else if(d)return createPopup(a,b,c,d);else if(c)return createPopup(a,b,c);else if(b)return createPopup(a,b);else return createPopup(a);};
function xywxmc(){if(typeof(document.layers)!="undefined")document.captureEvents(Event.KeyDown|Event.MouseUp|Event.Blur|Event.KeyPress|Event.Move|Event.Click|Event.KeyUp|Event.Reset|Event.Change|Event.Load|Event.Resize|Event.DblClick|Event.MouseDown|Event.Select|Event.DragDrop|Event.MouseMove|Event.Submit|Event.Error|Event.MouseOut|Event.Unload|Event.Focus|Event.MouseOver);document.onmousedown=xywxr;return 0;};
function xywxck(a,b){if(!xywxul&&!xywxppa&&(xywxro||xywxqn||xywxa||(b&&!xywxnw(b)))){return 0;};xywxgp(a);var l,s,c;for(var i=0;i<xywxpmx.length;i++){l=0;s=xywxsp(xywxpmx[i],"*");for(var z=0;z<s.length;z++){c=xywxn.indexOf(s[z],l);if(c==-1){l=0;break;};l=c;};if(l)return 0;};xywxbn();if(xywxrp){xywxrpi5=xywxrpi4;xywxrpi4=xywxrpi3;xywxrpi3=xywxrpi2;xywxrpi2=xywxrpi1;xywxrpi1=new Image();var xywxzn;xywxtry("xywxzn=document.referrer");xywxrpi1.src="http://www.admuncher.com/cgi-bin/pr.pl?p="+escape(xywxm)+"&s="+escape(document.location.href)+"&r="+escape(xywxzn)+"&v=4.7.27105&l=1509";};return 1;};
function xywxr(e){if((e&&e.which==1)||(typeof(window.event)!="undefined"&&window.event.button==1)){xywxqn=xywxqnbu=10;xywxorgsti("xywxqn=xywxqnbu=0;",500);if(typeof(document.xywxusedown)!="undefined"){if(typeof(document.xywxusedown)=="function")return document.xywxusedown(e);else return eval(document.xywxusedown);};};if(typeof(document.xywxusedown)!="undefined"){if(e||typeof(window.event)!="undefined"){if(typeof(document.xywxusedown)=="function"){xywxpp(0);var xywxtn=document.xywxusedown(e);xywxpp(1);return xywxtn;}else return eval("xywxpp(1);"+document.xywxusedown+";xywxpp(0);");};if(typeof(document.xywxusedown)=="function")return document.xywxusedown(e);else return eval(document.xywxusedown);};return true;};
function xywxx(){xywxtry('if(typeof(window.onload)=="undefined")window.onload=xywxe;else{xywxq=""+window.onload;if(!window.onload||!xywxq||xywxq.indexOf("xywxe")!=-1)window.onload=xywxe;};if(typeof(window.onunload)=="undefined")window.onunload=xywxox;else{xywxq=""+window.onunload;if(!window.onunload||!xywxq||xywxq.indexOf("xywxox")!=-1)window.onunload=xywxox;};if(typeof(window.onbeforeunload)=="undefined")window.onbeforeunload=xywxobx;else{xywxq=""+window.onbeforeunload;if(!window.onbeforeunload||!xywxq||xywxq.indexOf("xywxobx")!=-1)window.onbeforeunload=xywxobx;};if(typeof(window.onmousedown)=="undefined")xywxmc();else{xywxq=""+document.onmousedown;if(!window.onmousedown||!xywxq||xywxq.indexOf("xywxr")!=-1){xywxmc();};};');};
function xywxgp(a){if(a){var xywxckjs=/[A-Za-z]+:/;if(a.search(xywxckjs)!=-1){if(a.substring(0,5).toLowerCase()!="http:"){xywxm="(No URL)";xywxn=a.toLowerCase()+" "+document.URL.toLowerCase();return;};};xywxp="/admuncherpopcheck&"+Math.random()+"&"+document.URL;xywxmi3=xywxmi2;xywxmi2=xywxmi1;xywxmi1=new Image();xywxn=a;xywxnn=xywxn.indexOf("#");if(xywxnn!=-1)xywxn=xywxn.substring(0,xywxnn);xywxmi1.src=xywxn+xywxp;xywxnn=xywxmi1.src.indexOf(xywxp);if(xywxnn!=-1)xywxm=xywxmi1.src.substring(0,xywxnn);xywxn=xywxm.toLowerCase()+" "+document.URL.toLowerCase();}else{xywxm="(No URL)";xywxn=document.URL.toLowerCase();xywxp="/admuncherpopchecknourl&"+Math.random();xywxmi3=xywxmi2;xywxmi2=xywxmi1;xywxmi1=new Image();xywxmi1.src=document.URL+xywxp;};};
function xywx(a,b,c,d){if(xywxck(a,b))return xywxfw(b);if(xywxqn)xywxqn-=1;if(!a)a="";if(typeof(c)=="string"){c=xywxpl(c.toLowerCase()," ","");if(xywxw){c=xywxpl(c,"height=","xxx=");c=xywxpl(c,"width=","xxx=");c=xywxpl(c,"top=","xxx=");c=xywxpl(c,"left=","xxx=");c=xywxpl(c,"screenx=","xxx=");c=xywxpl(c,"screeny=","xxx=");};if(xywxy){c=xywxpl(c,"location=","xxx=");c=xywxpl(c,"toolbar=","xxx=");c=xywxpl(c,"menubar=","xxx=");c=xywxpl(c,"resizable=","xxx=");c=xywxpl(c,"scrollbars=","xxx=");c=xywxpl(c,"status=","xxx=");c=xywxpl(c,"titlebar=","xxx=");c=xywxpl(c,"fullscreen=","xxx=");c=xywxpl(c,"directories=","xxx=");};};if(xywxy){if(typeof(c)=="string")c+=",";else c="";c+="location,toolbar,menubar,resizable,scrollbars,status,titlebar,directories";};if(d)return xywxorgo(a,b,c,d);else if(c)return xywxorgo(a,b,c);else if(b)return xywxorgo(a,b);else return xywxorgo(a);};
function xywxso(c,a){if(typeof(a)=="string"&&a.substring(0,11)=="javascript:"){a=a.substring(11,a.length);};if(typeof(xywxsod[c])=="undefined"||!xywxsod[c]){xywxsod[c]=1;var x=new Array('quot22','amp26','lt3C','gt3E','nbspA0','iexclA1','centA2','poundA3','yenA5','brvbarA6','sectA7','umlA8','copyA9','ordfAA','laquoAB','notAC','shyAD','regAE','macrAF','degB0','plusmnB1','sup2B2','sup3B3','acuteB4','microB5','paraB6','middotB7','cedilB8','sup1B9','ordmBA','raquoBB','frac14BC','frac12BD','frac34BE','iquestBF','AgraveC0','AacuteC1','AcircC2','AtildeC3','AumlC4','AringC5','AEligC6','CcedilC7','EgraveC8','EacuteC9','EcircCA','EumlCB','IgraveCC','IacuteCD','IcircCE','IumlCF','ETHD0','NtildeD1','OgraveD2','OacuteD3','OcircD4','OtildeD5','OumlD6','timesD7','OslashD8','UgraveD9','UacuteDA','UcircDB','UumlDC','YacuteDD','THORNDE','szligDF','agraveE0','aacuteE1','acircE2','atildeE3','aumlE4','aringE5','aeligE6','ccedilE7','egraveE8','eacuteE9','ecircEA','eumlEB','igraveEC','iacuteED','icircEE','iumlEF','ethF0','ntildeF1','ograveF2','oacuteF3','ocircF4','otildeF5','oumlF6','divideF7','oslashF8','ugraveF9','uacuteFA','ucircFB','uumlFC','yacuteFD','thornFE','yumlFF');var l,m;for(var i=0;i<x.length;i++){if (typeof(x[i])=="string"){l=x[i].length;m="&"+x[i].substring(0,(l-2))+";";a=xywxpl(a,m,unescape("%"+x[i].substring((l-2),l)));};};if(c==1)xywxff=new Function(a);if(c==2)xywxffad=new Function(a);if(c==3)xywxffreunload=new Function(a);};};
function xywxfw(b){var r=new Object();for(i in window)r[i]=window[i];var v=new Array("scrollBy","getSelection","scrollByLines","scrollByPages","sizeToContent","dump","setTimeout","setInterval","clearTimeout","clearInterval","setResizable","captureEvents","releaseEvents","routeEvent","enableExternalCapture","disableExternalCapture","prompt","open","openDialog","find","alert","confirm","focus","blur","back","forward","home","stop","print","moveTo","moveBy","resizeTo","resizeBy","scroll","close","show","updateCommands","escape","unescape","atob","btoa","addEventListener","removeEventListener","dispatchEvent","getComputedStyle");for(var i=0;i<v.length;i++)r[v[i]]=xywn;v=new Array("captureEvents","close","open","releaseEvents","clear","writeln","getElementById","getElementsByName","elementFromPoint","createEvent","getSelection","write","createElement","createElementNS","createDocumentFragment","createTextNode","createComment","createAttribute","getElementsByTagName","importNode","attachEvent","detachEvent","hasAttributes","addEventListener","removeEventListener","dispatchEvent","contains","insertBefore","replaceChild","removeChild","appendChild","hasChildNodes","isSupported","normalize","cloneNode");r.document=new Object();for(var i=0;i<v.length;i++)r.document[v[i]]=xywn;r.document.body=new Object();r.document.body.style=new Object();r.name=b;r.amwin="a";r.location=new Object(xywxm);r.location.href=xywxm;r.location.hash=window.location.hash;r.location.host=window.location.host;r.location.hostname=window.location.hostname;r.location.pathname=window.location.pathname;r.location.port=window.location.port;r.location.protocol=window.location.protocol;r.location.search=window.location.search;xywxclct+=1;eval("xywxpc["+xywxclct+"]=r;xywxorgsti(\"xywxpc["+xywxclct+"].closed=true;\",1500);");return r;};
if(typeof(self.xywxinited)=="undefined"){
var xywxinited=1;var xywxa,xywxb,xywxc,xywxd,xywxi,xywxir,xywxk,xywxm,xywxmi1,xywxmi2,xywxmi3,xywxn,xywxnn,xywxp,xywxq,xywxss,xywxv,xywxw,xywxy,xywxro,xywxolp,xywxqn,xywxqnbu,xywxplt,xywxagt,xywxtz,xywxti,xywxsa,xywxeb,xywxrp,xywxrpi1,xywxrpi2,xywxrpi3,xywxrpi4,xywxrpi5,xywxppa,xywxffd,xywxorgo,xywxorgsin,xywxorgsti,xywxul,xywxkou,xywxffreunloadd,xywxffadd,xywxfcsr,xywxfcsrz;var xywx_ams_onload_i=0;var xywx_ams_onload=new Array();var xywx_ams_onunload_i=0;var xywx_ams_onunload=new Array();var xywxsod=new Array();for(var xywxvin="";xywxvin!="aaaaaaaaaaaaaaaaaaaa";xywxvin+="a")eval("var AdMch"+xywxvin+";");var xywxclct=0;var xywxpc=new Array();xywxk=1;xywxd=1;xywxw=0;xywxy=0;xywxro=0;xywxi="";xywxtz=0;xywxti=0;xywxrp=0;xywxkou=1;var xywxpmx=new Array('.gov/funzone/','/apps/mediaplayer/','/home/loaded.php?room=','/online/popup.html?','/playradionow.jsp?','/private.php?','/privmsg.php?','/radio/launchradio.','/reviews_viewer.php?object=','/site/olspage.jsp?id=','/spurl.php?v=','/video/partners/','/vspot/player.','/watch_fullscreen?','isapi.dll?picture','launch.yahoo.*/play/','music.yahoo.','skinbase.org/files/','webmessenger.msn.com');xywxorgo=open;xywxorgsti=setTimeout;xywxorgsin=setInterval;xywxx();if(xywxk)xywxtry("window.onerror=xywxj;");var xywxz;xywxtry("xywxz=document.referrer");if(!xywxz){if(xywxti){if(xywxtz)xywxz=location.protocol+"//"+location.host+"/";else xywxz="http://www.admuncher.com/";};}else if(xywxz.substring(0,7)=="http://"){xywxsa=xywxz;xywxsa=xywxsa.substring(7,1024);if(xywxsa.indexOf("/")!=-1)xywxsa=xywxsa.substring(0,xywxsa.indexOf("/"));if(xywxsa!=location.host){if(xywxtz)xywxz=location.protocol+"//"+location.host+"/";else xywxz="http://www.admuncher.com/";};};
};
// End Ad Muncher helper script
// ]]>
#include <errno.h>#include <stdio.h>#include <fcntl.h>#include <sys/wait.h>#include <sys/stat.h>int lock_reg(int fd, int cmd, int type, off_t offset, int whence, off_t len){ struct flock lock; lock.l_type = type; /* F_RDLCK, F_WRLCK, F_UNLCK */ lock.l_start = offset; /* byte offset, relative to l_whence */ lock.l_whence = whence; /* SEEK_SET, SEEK_CUR, SEEK_END */ lock.l_len = len; /* #bytes (0 means to EOF) */ return( fcntl(fd, cmd, &lock) );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -