linux/fs/compat.c
<<
>>
Prefs
   1/*
   2 *  linux/fs/compat.c
   3 *
   4 *  Kernel compatibililty routines for e.g. 32 bit syscall support
   5 *  on 64 bit kernels.
   6 *
   7 *  Copyright (C) 2002       Stephen Rothwell, IBM Corporation
   8 *  Copyright (C) 1997-2000  Jakub Jelinek  (jakub@redhat.com)
   9 *  Copyright (C) 1998       Eddie C. Dost  (ecd@skynet.be)
  10 *  Copyright (C) 2001,2002  Andi Kleen, SuSE Labs 
  11 *  Copyright (C) 2003       Pavel Machek (pavel@ucw.cz)
  12 *
  13 *  This program is free software; you can redistribute it and/or modify
  14 *  it under the terms of the GNU General Public License version 2 as
  15 *  published by the Free Software Foundation.
  16 */
  17
  18#include <linux/stddef.h>
  19#include <linux/kernel.h>
  20#include <linux/linkage.h>
  21#include <linux/compat.h>
  22#include <linux/errno.h>
  23#include <linux/time.h>
  24#include <linux/fs.h>
  25#include <linux/fcntl.h>
  26#include <linux/namei.h>
  27#include <linux/file.h>
  28#include <linux/fdtable.h>
  29#include <linux/vfs.h>
  30#include <linux/ioctl.h>
  31#include <linux/init.h>
  32#include <linux/ncp_mount.h>
  33#include <linux/nfs4_mount.h>
  34#include <linux/syscalls.h>
  35#include <linux/ctype.h>
  36#include <linux/dirent.h>
  37#include <linux/fsnotify.h>
  38#include <linux/highuid.h>
  39#include <linux/personality.h>
  40#include <linux/rwsem.h>
  41#include <linux/tsacct_kern.h>
  42#include <linux/security.h>
  43#include <linux/highmem.h>
  44#include <linux/signal.h>
  45#include <linux/poll.h>
  46#include <linux/mm.h>
  47#include <linux/eventpoll.h>
  48#include <linux/fs_struct.h>
  49#include <linux/slab.h>
  50#include <linux/pagemap.h>
  51
  52#include <asm/uaccess.h>
  53#include <asm/mmu_context.h>
  54#include <asm/ioctls.h>
  55#include "internal.h"
  56
  57int compat_log = 1;
  58
  59int compat_printk(const char *fmt, ...)
  60{
  61        va_list ap;
  62        int ret;
  63        if (!compat_log)
  64                return 0;
  65        va_start(ap, fmt);
  66        ret = vprintk(fmt, ap);
  67        va_end(ap);
  68        return ret;
  69}
  70
  71#include "read_write.h"
  72
  73/*
  74 * Not all architectures have sys_utime, so implement this in terms
  75 * of sys_utimes.
  76 */
  77asmlinkage long compat_sys_utime(const char __user *filename,
  78                                 struct compat_utimbuf __user *t)
  79{
  80        struct timespec tv[2];
  81
  82        if (t) {
  83                if (get_user(tv[0].tv_sec, &t->actime) ||
  84                    get_user(tv[1].tv_sec, &t->modtime))
  85                        return -EFAULT;
  86                tv[0].tv_nsec = 0;
  87                tv[1].tv_nsec = 0;
  88        }
  89        return do_utimes(AT_FDCWD, filename, t ? tv : NULL, 0);
  90}
  91
  92asmlinkage long compat_sys_utimensat(unsigned int dfd, const char __user *filename, struct compat_timespec __user *t, int flags)
  93{
  94        struct timespec tv[2];
  95
  96        if  (t) {
  97                if (get_compat_timespec(&tv[0], &t[0]) ||
  98                    get_compat_timespec(&tv[1], &t[1]))
  99                        return -EFAULT;
 100
 101                if (tv[0].tv_nsec == UTIME_OMIT && tv[1].tv_nsec == UTIME_OMIT)
 102                        return 0;
 103        }
 104        return do_utimes(dfd, filename, t ? tv : NULL, flags);
 105}
 106
 107asmlinkage long compat_sys_futimesat(unsigned int dfd, const char __user *filename, struct compat_timeval __user *t)
 108{
 109        struct timespec tv[2];
 110
 111        if (t) {
 112                if (get_user(tv[0].tv_sec, &t[0].tv_sec) ||
 113                    get_user(tv[0].tv_nsec, &t[0].tv_usec) ||
 114                    get_user(tv[1].tv_sec, &t[1].tv_sec) ||
 115                    get_user(tv[1].tv_nsec, &t[1].tv_usec))
 116                        return -EFAULT;
 117                if (tv[0].tv_nsec >= 1000000 || tv[0].tv_nsec < 0 ||
 118                    tv[1].tv_nsec >= 1000000 || tv[1].tv_nsec < 0)
 119                        return -EINVAL;
 120                tv[0].tv_nsec *= 1000;
 121                tv[1].tv_nsec *= 1000;
 122        }
 123        return do_utimes(dfd, filename, t ? tv : NULL, 0);
 124}
 125
 126asmlinkage long compat_sys_utimes(const char __user *filename, struct compat_timeval __user *t)
 127{
 128        return compat_sys_futimesat(AT_FDCWD, filename, t);
 129}
 130
 131static int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf)
 132{
 133        struct compat_stat tmp;
 134
 135        if (!old_valid_dev(stat->dev) || !old_valid_dev(stat->rdev))
 136                return -EOVERFLOW;
 137
 138        memset(&tmp, 0, sizeof(tmp));
 139        tmp.st_dev = old_encode_dev(stat->dev);
 140        tmp.st_ino = stat->ino;
 141        if (sizeof(tmp.st_ino) < sizeof(stat->ino) && tmp.st_ino != stat->ino)
 142                return -EOVERFLOW;
 143        tmp.st_mode = stat->mode;
 144        tmp.st_nlink = stat->nlink;
 145        if (tmp.st_nlink != stat->nlink)
 146                return -EOVERFLOW;
 147        SET_UID(tmp.st_uid, from_kuid_munged(current_user_ns(), nlink)
uid6">  36#include <c#L48" id1="L48" class="line" name1="L4814 138        SGT_UID" class="sref">SGT_UID(tmp.gt_uid, frog_kuid_munged(current_user_ns(), nlink)
uid6">  36#include <cL139" id=="L49" class="line" name1="L4914 139        tmp.old_encode_dev(stat->rdev6">  36#include <c#L50" id1="L50" class="line" name1="L50150145        i/a>(nlink)
nlink)
 &(), nlink)
)
EOVERFLOW;
tmp.nlink)
 = stat->nlink)
;
tmp.stat->tv_sec;
tmp.stat->tv_nsec;
tmp.stat->tv_sec;
tmp.stat->tv_nsec;
tmp.stat->tv_sec;
tmp.stat->tv_nsec;
tmp.stat->tmp.nlink)
 = stat->nlink)
;
ubuf, &tmptmpEFAULT< :urn 0;
asmlinkage long compat_snewat_sdev(const char __user, filename}
compat_stat __user *kstatstatfilename, &stat6">  36#include <c#L71" id1="L71" class="line" name1="L7117 111        if (cp_compat_stat, &stat<>(), asmlinkage long compat_snewlat_sdev(const char __user, filename}
compat_stat __user *kstatstatfilename, &stat6">  36#include <c#L83" id1="L83" class="line" name1="L831>  83        if (cp_compat_stat, &stat<>(), 
asmlinkage long compat_snewfat_s_stat(unsigned int dfd
__user *filename,
compat_stat __user *kstatstatdfd, filename, &stat<>(), cp_compat_stat, &stat<>(), }
 101<#endifa>}

 103asmlinkage long compat_snewfat_stat(unsigned int dfd
             >, struct compat_stat __user 105{
        struct kstatstat      c int dfd, &stat6">  36#include <2#L108" id2"L108" class="line" name2"L10820  58
 109        if (!                cp_compat_stat, &stat<>(),         return }
}
 114__user *ubuf, struct {
 116     a>{
        i0, sizuct ubuf-> 118                i/a>( 119                  || nlink)
nlink)
, &a 0xffffffff00000000ULL//a>
 120             /a>        return -EOVERFLOW;
 121              a>
 122 */
 123                i|| nlink)

              >) &&ami|| nlink)
, &a 0xffffffff00000000ULL///a>
                        return -EOVERFLOW;
                i||               >) &&ami||                         return -EOVERFLOW;
     /a>}
        if (!EOIFY_WRITEink" class="sre>EOIFY_WRITEtat<>(), ubuf, sizea> *ubuf) ||
         a> =__udev(ubuf->         a> =__udev(nlink)
, &ubuf->nlink)
) ||
         a> =__udev(ubuf->         a> =__udev(ubuf->         a> =__udev(ubuf-> 136         a> =__udev(nlink)
, &ubuf->nlink)
) ||
         a> =__udev(ubuf->         a> =__udev(, &ubuf->) ||
         a> =__udev(ubuf->         a> =__udev(ubuf->         a> =__udev(nlink)
ubuf->nlink)
) ||
 142         a> =__udev(flags<[1], &ubuf->flags) ||
         a> =__udev(ubuf->nlink)
, sizea>(ubuf->nlink)

                return -EFAULT;
        return 0;
}


f f="at_sfr.c and */
f modt toamodtin/
 */
asmlinkage long __user *__user *tmp;
tmpcp_compat_sfr_ns" class="sreput>cp_compat_sfrtat *tmpasmlinkage long dfd, struct __user *tmp;
dfd, &tmpcp_compat_sfr_ns" class="sreput>cp_compat_sfrtat *tmpcp_compat_sfr="L64" class="sreput>cp_compat_sfr="tat, struct  __user *ubuf, struct ubuf->nlink)
nlink)
, &a 0xffffffff00000000ULL//a>
EOVERFLOW;

,uff thattic o 32 bitst"> */
nlink)

nlink)
, &a 0xffffffff00000000ULL///a>
EOVERFLOW;
EOVERFLOW;
EOIFY_WRITEink" class="sre>EOIFY_WRITEtat<>(), ubuf, sizea> *ubuf) ||
=__user" class="sref"put>=__udev(ubuf->=__user" class="sref"put>=__udev(nlink)
, &ubuf->nlink)
) ||
=__user" class="sref"put>=__udev(ubuf->=__user" class="sref"put>=__udev(ubuf->=__user" class="sref"put>=__udev(ubuf->=__user" class="sref"put>=__udev(nlink)
, &ubuf->nlink)
) ||
=__user" class="sref"put>=__udev(ubuf->=__user" class="sref"put>=__udev(, &ubuf->) ||
=__user" class="sref"put>=__udev(ubuf->=__user" class="sref"put>=__udev(ubuf->=__user" class="sref"put>=__udev(nlink)
ubuf->nlink)
) ||
=__user" class="sref"put>=__udev(flags<[1], &ubuf->flags) ||
=__user" class="sref"clear>=__udev(ubuf->nlink)
, sizea>(ubuf->nlink)

EFAULT;
        return 0;
 101}

 103asmlinkage long (const char __user *compa, s_sser __user *) {
        struct tmp;
     ic int 
     i  i||                 return -
     nt tmp        if (!             nt cp_compat_sfr="L64" class="sreput>cp_compat_sfr="tat *tmp        return }
 116}
asmlinkage long (unsigned int dfdcompa, s_sser __user *{
        struct tmp;
     ic int 
        i||  123                return -
     nt dfd, &tmp        if (!             nt cp_compat_sfr="L64" class="sreput>cp_compat_sfr="tat *tmp        return }


asmlinkage long compat_suat_stat(unsignng compuat_stat __user *{
     >, struct compuat_stat tmp;
        struct      ic int  *        if ( 142                return }
     rn tmp<, 0/a>, size>, struct compuat_stat<)/n 0;
     nt tmp.        tmp. =         if (tmp, size>, struct compuat_stat<)//a>)
EFAULT;
cp_compflockULT" class="sreget>cp_compflocktat, struct __user *EOIFY_READink" class="sre>EOIFY_READdfd=__user" class="sref"get>=__udev(=__user" class="sref"get>=__udev(=__user" class="sref"get>=__udev(=__user" class="sref"get>=__udev(=__user" class="sref"get>=__udev(EFAULT;
cp_compflockULT" class="sreput>cp_compflocktat, struct __user *EOIFY_WRITEink" class="sre>EOIFY_WRITEtat<>(), =__user" class="sref"put>=__udev(=__user" class="sref"put>=__udev(=__user" class="sref"put>=__udev(=__user" class="sref"put>=__udev(=__user" class="sref"put>=__udev(EFAULT;
}
cp_compflock="L64" class="sreget>cp_compflock="tat, struct  __user *EOIFY_READink" class="sre>EOIFY_READdfd=__user" class="sref"get>=__udev(=__user" class="sref"get>=__udev(=__user" class="sref"get>=__udev(=__user" class="sref"get>=__udev(=__user" class="sref"get>=__udev(EFAULT;
cp_compflock="L64" class="sreput>cp_compflock="tat, struct  __user *EOIFY_WRITEink" class="sre>EOIFY_WRITEtat<>(), =__user" class="sref"put>=__udev(=__user" class="sref"put>=__udev(=__user" class="sref"put>=__udev(=__user" class="sref"put>=__udev(=__user" class="sref"put>=__udev(EFAULT;
        return 0;
 101}
}
}
asmlinkage long (unsigned int dfd(unsigned int              a>(unsigna> long {
     ng      >, struct      a> long 
     switch if (     caseong      caseong      caseong              ng cp_compflockULT" class="sreget>cp_compflocktat, &                if (                     breakn 0;
             a> fr_ns" class="sreget>frdev              =              ng dfd              =                 if ( 123                      a>
EOVERFticuthom case. */
}
                        if (                             ng EOVERFLOW;
                        if (                             ng                         if (                             ng cp_compflockULT" class="sreput>cp_compflocktat, &             /a>}
             breakn 0;

     caseong      caseong      caseong              ng cp_compflock="L64" class="sreget>cp_compflock="tat, &                if (fr_ns" class="sreget>frdev             ng dfdfr_ns" class="sreset>frdev                if () &&amng eeuabove for s="commaryt*> */
EOVERFLOW;
cp_compflock="L64" class="sreput>cp_compflock="tat, &dfdasmlinkage long dfd(unsigned int )
dfdasmlinkage l/a>
__user *;
fr_ns" class="sreget>frdev        if (=__user" class="sreget>=__udev(EFAULT;
fr_ns" class="sreset>frdev      a>__u poed _u cast is valid beca>__ ofuthe set>fr()t*> */
__user, &fr_ns" class="sreset>frdev      a>__ it's a >__u addressu*> */
=__user" class="sreput>=__udev
asmlinkage l/a>
                              a>(unsigna> long                               a>(unsigna> long                               >, struct __user *                              >, struct __user *) {
     a> long         struct         struct __user *
     ng EFAULT;
        if (EOIFY_WRITEink" class="sre>EOIFY_WRITEtat<>(),                              ng              goto/a>         i> *                i> *                     goto/a>              ng __u_spacname" class="srecp_compalloc">__u_spacndev, sizea> *                if (                     goto/a>  123     } a>;
      =          retong }
}
EOIFY_WRITEink" class="sre>EOIFY_WRITEtat< :ong 
            const  >, struct __user *             a>(unsigna> long             (>, struct {
     ng      >, struct  *        ned int 
      a>
        if ( *ng ;
 */
 */
lngthg isnot< a>-a= * andfitatingaetva/
, m_.. */

lngthg islimiteignto_MA_RW_COUNT, uthrheism1*/
bility.. */
 */
, m_stat" class="srede=comp(>, m_c122 =__user" class="sr__oget>=__rdev(=__user" class="sr__oget>=__rdev(EFAULT;
, m_snot, m_ ..tu*> */
EFAULT;
->->, m_stat" class="srede=comp>, m_c122<)/a> ;

 l/a>
__user *, struct __user __user *) {
     ng     ned int }
     for if (                i> *                        return -EFAULT;
                if (                        return -EFAULT;
    }
        return 0;
}
}
)
asmlinkage l/a>
__user *) {
    e>, struct __user __user *     a> long  123/a>;
        if (                return -}
        if (            if (    n 0;
     ng __u_spacname" class="srecp_compalloc">__u_spacndev     ng         if (!             ng         return }
}
, struct     uct          ng      ng      a>(unsigchar      ng      ng      ng      ng      ng  ;
 ;
 m_stat" class="srode=comu a> m_udev  m_stat" class="srode=comu a> m_udev  m_stat" class="srode=com a> m_udev  m_stat" class="srode=comu a> m_udev  m_stat" class="srode=comu a> m_udev  m_stat" class="srode=comu a> m_udev ;
 m_stat" class="srode=comu a> m_udev ;
;
;
;
;
}


, struct      ng      ng ;
)
,inestat" class="srnfs_ >,ine 119 *                                  >, struct ) {
     ng      ng }
;
, struct      ng      ng     uct          ng      ng      ng      ng      ng      ng      >, struct      >, struct      >, struct ;
         ng      ng      ng      ng ;
}
) {
     ed int         if (             >, struct              >, struct  123/a>;
             /a>              =               =               = ,inestat" class="srode=comnfs_ >,ine 119za>, &, &,inestat" class="srode=comnfs_ >,ine 119za>, &,inestat" class="srode=comnfs_ >,ine 119za>, &asmlinkage   ng __user 
__user 
__user __user ,inestat" class="srodpy_mount_ >,ineudev((,inestat" class="srodpy_mount_ >,ineudev(, &
        if (                if (!                     ng             } else     if (!                     ng                         gotoa            }
    }
     ng                  ng 
     ng      ng     uct (     ng         return }
;
, struct      ng      ng     /a>(unsigshort;
    char<        ng ;
;

, struct      >, struct __user(     ed int ;
;
                 ng ) {
     >, struct      >, struct __user(     ng  123/a>;
         ng                 ret-     ng          a, si(, &;
(;
asmlinkage   ng __user(edirmser" class="srode=comfil a>edirudev, & m_stat" class="srode=comu a> m_udev m_stat" class="srode=comu a> m_udev;
     >, struct __user(     >, struct __user(     ed int      ed int ;
}
            int ) {
     >, struct __user     >, struct      ng      ed int ;
             ng (;
      = _d    we fail.. u*> */
        if (                ret-    uct          a, si(             ng                 ret-    }
     ng          ng                  ng                     gotoa    }
    uct          ng             gotoa        if (            gotoa        if ((            gotoa         ng             gotoa         ng __user            gotoa         ng __user(     ng      ng         return 0;
      =         ret-}
asmlinkage   ng __user(unsig ed int (unsig/a9 )/a>9__useer->9(<96 m_stat" class="srode=co84="L64" 9lass="line" nam84="L68679114     ng             9et-;
;
}
}
edi9mser" cla9s="srdireom 142(uns9g ed 97 123/a>;

       ng       = ;
, &->              9 ret-98;
edirud9v98" i95""L94" class="line" nam9 ;
}
( m_9dev m_stat9 class="srode=comu a> m_9dev    /a>(unsigshort             >, struct      >, struct ;
     ed int ;
;
10rua href="+cdireommser" classnt      n/er">cne"=lename" class="sr10r1ct ;
}
      =         if ( m_10rcl>10rg     }
     ng     char<      10r10r;
     ed int 10r="+cd_offsemmser" claaaaaaaaass="srrec=lestat<- 1<0n 0;
__use10use>10us (!    }
    uct 10ua href="+cne"fd" mser" class="srefaulm 142_unal" clakstat" class="sroaulm 142_unal" cla1915 142     ed 1117<   4"Le" class="srrec=lestat     ed inteffsemmser" cla   <        ng 10ua href="+cne"=lename" class="srne"=lestat<0n 0;
        if (                10 11>10uef="+c  c=lename" class="srrec=lestat<- 1<0n 0;
        if (10_        if (                ret- >10_ef="+cd_rec=lename" class="srd_rec=lestat)0n 0;
10_         ng 10_a href="+cne"=lename" class="srne"=lestat)0n 0;
      10m95>10_         ng __user(                    g10/a>>10_16" i84="L76" class="line" n="srefaulm 142:
     ng      ng ->10_oputdneedee=dfd" clae" class="srrec=lestat            g10932>10s      = -&10las>10s2putdneedee=dfd" cla14940  85      = 10s a href="+cdireommser" class10s5ct             g10930>10s5putds="srne"=lestat"line" nam94="L4942 128/a>}
asmlinkage   ng 10sa href="+cne"=lename"95ommser" class="srdirref="fs/compt __user            g10930>10s16" it95#4103" i95"L124" clas1038ct 10ns" i95""L98" class="line" nam95"L10eom 142;
;
10n/a>(;
__useer10n href="+cdireommser" fd" cla14940  85      =         104"L>10n16" i84="L76" class="line" nam84="L7872 146/a>;
;
}
10de<  = 10d80" i84="L80" class="line" nam84="L8880 130
     ng     ;
10d" i95""L94" class="line" nam10d6ct (unsig/a10   >10dedi10d7ct             g10850>10d 123/a>;
10def="+c  c=lename" claaulmmser" classam84="L888> 123/a>;

      " i94"L145" class="line" nam9href="+code=comfil a>edi10d9ct 
       ng ->10ss=>10ssa href="+cefaulmmser" class="srl="t35 120}10sf="+cEOVERFLOWLULT" cmser" class="srlass href="+crec=lenalass h14    int 10sef="+cd_rec=lename" caulmmser" class="srefaulm 142_unal" clakstat" class="sroaulm 142_unal" cla1915 142     ed of"+ceffsemmser" class="sroff(      = 10sa href="+cne"=lename"s="ssrbufmtat->->10s16" i84="L76" class="line" nam84="L8881 117/a>)
;
}
10coa hr#endaulufmtat->(uns10s=">10c0" i84="L90" class="line" na1072ct   95ommser" class="srdir956 121a>) {
10c href="+cd_ne" stat" ame" claaaaaaaa href=class="line" nam95"L10eom 142iovec10cg     uct ;
10c67" i84="L87"95ommser" class="srdiriovec10c->              1078 >1078a href="+cefaulmmser" classio_fnat<< 0;
;
      = 107/a>(edirud10s=">107 href="+cdireommser"  class="srne"=lestatouas="line" nam95"Lu nam9"srbufmtat->      = 107oputdneedee=dfd" class="sroputdneireom 142;
, &->;
  78    uct }
(10a m_10 cl>10a href="+cdireommser"  class="srne"=lestatouas="line" nam95"Lu nam9"srbufmtat->    /a>(unsigshort10a    char<      10610a;
  78    uct <" class="line" nam84="L8880  78    uct < o(10accurreom_dirmser" class="srourrer110if="+c  c=lename" class="srrec=lestat<- 1ouas="line" nam95"Lu nam9"srbufmtat->;
}
->11rfs=cmser" class="srREAD;
;
    /a>(unsigshort110    char<      11r110t;     ed 1o_fnat<< 0;
     ng ;
;
__use11use>111m<  = 111ef="+cd_rec=lename" cine" nam94"L129r    uct 11u href="+cd_ne" stat"                                 78    uct < o(11ug ->    uct < o1112<  =                 11 11>111oputdneedee=dfd" "+code=comss=uxiov(fs=cmser" class="srREAD;
fs=cmser" class="srREAD;
                ret- >11_ef="+cd_rec=lename" c+cfilnkacompat84cL144" fsnotify_as/coma href="+cbufusfsnotify_as/com84#L103" i84="L53" c" class="line" nam84="L8880sghmudev(112 href="+cd_ne" stat" s="ssrbufmtat->11_a href="+cne"=lename"+cfilnkacompat84cL144" fsnotify_modifya href="+cbufusfsnotify_modify84#L103" i84="L53" c" class="line" nam84="L8880sghmudev(      11m95>11_->                    g11/a>>11_16" ief="+cEFAULTLULT" class=11_8ct             g11932>113f="+cEOVERFLOWLULT" ccccccccccccx_direom compat94#9107" i94="vs -&11las>11s2putdt95#4103" i95"L124" clas11s3ct             g11935>113122" class="line" nam95"L129si95"at<< 0;
    0;
11s a href="+cdireommser" class11s5ct             g11930>113;
11sa href="+cne"=lename"ss="srrec=lestat<- 1ouas="line" nam95"Lu nam9"srbufmtat->            g11930>113      = ;
114if="+c  c=lename" class="srrec=lestat<- 1ouas="line" nam95"Lu nam9"srbufmtat->    uct <" class="line" nam84="L8880  78    uct ->11n/a>(114;
->        114"L>11n16" i84="L76" class="line" ninc2assco;
->;
->}
11de<  = 11d80" is/compat94#5104aline" nam94="L4942 128/a>}
115->(unsig/a11   >11d            g11850>11516" i84="L76" class="line" nsi95"at<< 0;
->115127" class="line" nam94"L129lestat<< 0;
->->11ss=>1168a href="+cefaulmmser" classam84="L7872 146/a>;
11611sef="+cd_rec=lename" cge" class="srfilnuser0n 0;
            g11865>116122" class="line" nam95"L129 o11sa href="+cne"reommser" classr    uct <" class="line" nam84="L8880  78    uct ->->11s16" i84="L76"fd" class="sroputdneedr->;
}
11780" is/compat94#5104" m 142ass=pr888vt 11c hreft95#4103" i95"L124" clas1174ct 11cg ->     ed int 117->;
117oputdneedee=dfd" "+code=comss=ux o117f (!;
    SPIPEa href="fs/compaSPIPEL139" i84="L79" class="line"1174ct ;
;
117 href="+cdireommser" reommser" classr    uct <" class="line" nam84="L8880  78    uct ->->     11am8>119eputds="srne"=lestataline" nam94="L4942 128/a>}
;
}
    int ->    uct ->    /a>(unsigshort11a    char<      11611a;
;
;
12r0" i8t95#4103" i95"L124" clas12r2ct }
    0;
, &->    /a>(unsigshort1202<  =     char<      12r12016" i84="L76" class="line" nr      = 120oputdneedee=dfd" class="sroputdneedeeuser//n 0;
120f (!->__use12use>121m<  = ->121="+cdata_plinkage" class="sr12u3ct 12u hrefs="srne"=lestatouas="line" nam95"Lu nam9href="fs/compat94#L114" 1214ct (121/a>(;
->121->->                12 11>121ef="+ef="+cEFAULTLULT" class=12u9ct                 ret- >12_ef="+cd_rec=lename" c+cx_direom compat94#9107" i94="vs 12_a href="+cne"95ommser" class="srdir956 121a>) {
->      12m95>122->                    g12/a>>12216" i84="L76" class="line" nlestat<< 0;
->            g12932>123f="+cEOVERFLOWLULT" cge" class="srfilnuser0n 0;
->123a href="+cne"reommser" class"="+cerro_user" class="sreref="fs/compat94#5104f_po->            g12930>123)
123->            g12930>12316" ief="+cEFAULTLULT" class=1238ct             g12931>123ccurrs="srne"=lestataline" nam94="L4942 128/a>}
124eputds="srne"=lestateom 142ass=pwritevt 1242putdt95#4103" i95"L124" clas1243ct ->124/a>(124->        124"L>12n16" i84="L76"fd" "+code=comss=ux o124124125sa href="+cefaulmclass="sroputdneedeeuser//n 0;
125f="+cEOVERFLOWLULT" cge" class="srfilnuser0n 0;
    SPIPEa href="fs/compaSPIPEL139" i84="L79" class="line"12d3ct ->125)
(unsig/a12   >125->            g12850>12516" ief="+cEFAULTLULT" class=12d8ct 125127" f="+cEFAULTLULT" class=12d9ct 126f="+cEOVERFLOWLULT" ccccx_direom compat94#9107" i94="vs 1262putdt95#4103" i95"L124" clas12s3ct             g12865>126122" class="line" nam95"L129lestat<< 0;
    int ->12sa href="+cne"fd" class="sroputdneed" m 142ass=pwritevt     uct ->126;
}
127eputdt95#4103" i95"L124" clas1271ct 127f="+cEOVERFLOx_direom 94="L5952 120->->127 href="+cd_ne+ulms/compat84c#L67nr_seg127g ->;
->127, stram84    pat84t94#9107" i94="v->127f (!->              1278 >128if="+c  c=lename" cla=lenlnuser, str u84    pat84t94#9107" i94="eom 142pt          >, streom 142pt pat84t94#9107" i94="v->;
, str u84    pat84t94#9107" i94="v->;
    uct     uct ->128 hrefef="+cEFAULTLULT" class=1286ct /*5* Exactly like +cbopen.c:ass=open()teexcept that it doesn't set the5* O_LARGEFILE flag.5*/;
}
             >, struct     uct ->    /a>(unsigshort1292<  =     char<      12612916" i/*;
5* Exactly like +cbopen.c:ass=openat()teexcept that it doesn't set the;
5* O_LARGEFILE flag.;
5*/;
}
             >, struct     uct ->    /a>(unsigshort1302<  =     char<      13r13016" i#defr< m94="L5952 120COMPAT_NFDBITS         >, strucCOMPAT_NFDBITS href="+cne(85* i95"of4ine" nam94"L129eom 142ucompat<< 0;
;
;
             >, struct __use13use>131if="+c  c=lename" cla=lename" ccccccccccccc+cfilnkage" class="timeval131ef="+cd_rec=lclass="line" nam95"L10timespec->131(131/a>(->1312<  = , strSTICKY_TIMEOUTS" nae4="L90" class="line" na1318ct                 13 11>131->/* No updateFfor"zero timeout5*/                ret- >13_ef="+cd_rec=lename" cfd" class="sroputdneedr->13_a href="+cne"ss="sroputdneedktime_am84t->      13m95>132->13_127" f="+cEFAULTLULT" class=13_9ct ->            g13932>133f="+csrbufmtat->->            g13935>133122" class="lename" cline" nam95"L10rtv->133a hresrbufmtat->            g13930>133 href="+cdireommser" aulmclass="sroputdnecopy_to>             >, strcopy_to>    pat84t94#9107" i94="pa href="fs/compp" na e"srfilnuser133->            g13930>133t;->            g13931>133->134if="+c  c=lename" claline" nam95"L10rt->->134g ->134/*        134"L>13416" icename" c* If anuapplication puts its timeval in L888-only memory, we;
5ename" c* don't want the Linux-specific updateFto the timeval to}
5ename" c* ca    a fault after the select has ufusletfputspan= 135eputdsspanufuser" ufum"L1<>5ename" c* successfully. However, beca    we're not updating the135f="+csspanufuser" ufum"L1<>5ename" c* timeval, we can't restart the system call.5ename" c*/135(unsig/a13   >135;
->            g13850>13516" i84="L76"fd" class="sroputdneedr->135ef="+ef="+cEFAULTLULT" class=13d9ct ->13ss=>136eputdsspanufuser" ufum"L1<>/*136f="+csspanufuser" ufum"L1<>5* Ooo,e" sty.  We need hereFto frob 32-bitcx_direom comps to1365* 64-bitcx_direom comps.            g13865>136122" sspanufuser" ufum"L1<>5*/13t pat895="L9 136;
, strDIV_ROUND_UPpat84t94#9107" i94="n          >, strnr8880telnuserCOMPAT_NFDBITS         >, strucCOMPAT_NFDBITS hreL"srbufmtat->}
137if="+c  c=lename" clax_direom compat94#9107" i94="odhref="+cfilnkageodhnam9"srbufmtat->137f="+csrbufmtat->137122" class="lename" c84="L76"fd" class="srfilnuser0n FAULTa href="+cbufuseFAULTfmta"srbufmtat->137a hresrbufmtat->     ed int 137 href="+cdireommser" t94#9107" i94="odhref="+cfilnkageodhnam9f"Line" nam94"L129n          >, strnr8880f& hre81UL"srbufmtat->, strnr8880f& hre= ~1UL"srbufmtat->;
, strnr8880Lat95#4103" i95"L124" clas1378ct 137->137f (!am84             >, stra>am84    pat84t94#9107" i94="lam84             >, stra>am84    pat84t94#9107" i94="oa href="fs/comph" na et94#9107" i94="ufdset<< 0;
              1378 >138if="+c  c=lename" cla=lene" c84="L76"fd" class="srfilnuser0n FAULTa href="+cbufuseFAULTfmta"srbufmtat->;
->->, strnr8880f-= 2"srbufmtat->;
138 href="+cdireommser" aulmt94#9107" i94="odhref="+cfilnkageodhnam9f& hre& hre8lnuseram84             >, stra>am84    pat84=94="L5952 120138->/* TrL9ky, muef="lear fullax_direom compain the5ename" cename" c= kernel fdset at the end, this makes sureFtha1paspan= 5ename" cename" c= actually happens.;
5ename" cename" c=/}
    int , strnr8880f+ 1)f& hre8~1)*i95"of4ine" nam94"L129eom 142ucompat<< 0;
-> m_13 cl>139 hrefef="+cEFAULTLULT" class=1396ct     /a>(unsigshort1392<  =     char<      13613916" i95="L9 ;
;
;
;
->}
, strnr8880f"Line" nam94"L129DIV_ROUND_UP         >, strDIV_ROUND_UPpat84t94#9107" i94="n          >, strnr8880telnuserCOMPAT_NFDBITS         >, strucCOMPAT_NFDBITS hreL"srbufmtat->    char<      14r14016" i84="L76" class="line" nodhref="+cfilnkageodhnam9f"Line" nam94"L129n          >, strnr8880f& hre81UL"srbufmtat->;
->;
, strnr8880Lat95#4103" i95"L124" clas141uct __use14use>141if="+c  c=lename" clax_direom compat94#9107" i94="oa href="fs/comph" na et94#9107" i94="l->->141ef="+cd_rec=lename" cline" nam95"L10oa href="fs/comph" na="Line" nam94"L129l->141122" class="lename" caulmlnuser u84             >, stra> u84    pat84t94#9107" i94="l u84             >, stra> u84    pat84t94#9107" i94="oa href="fs/comph" na et94#9107" i94="ufdset<< 0;
(141g ->->141->                14 11>141 u84             >, stra> u84    pat84=94="L5952 120141f (!->142                ret- >142="+cdata_plinkage" class="sr1423ct 14_a hresspanufuser" ufum"L1<>/*      14m95>1425* This is a virtual copy of sys_select from +cbselect.c and probably5* should be ufusarom to it from timeFto time88span=                     g14/a>>14216" ic=//*5* We canuactually fd" cla RESTARTSYS instead of    TR, but I'putspan=             g14932>143f="+csspanufuser" ufum"L1<>5* like to be uertain this leads to no problems. So I fd" clutspan= 5*    TR juef=for"safety.            g14935>143122" sspanufuser" ufum"L1<>5*143a hresspanufuser" ufum"L1<>5* Update:a RESTARTSYS breaks at least the xviewufuock binary, so            g14930>1435* I'm trying  RESTARTNOHAND"which restart only when you want to.1435*/            g14930>143t;            g14931>143f (!144eputdt95#4103" i95"L124" clas1441ct ->->144g 144        144"L>14416" i84="L76"fd" "+code=comss=uxn         >, strn8880f<c#L66" i74="L96" class="li1448ct ;
144->1458a href="+cefaspanufuser" ufum"L1<>/* max_fds canuincrease, so grab it once to avoim race */145f="+cEOVERFLO94="L5952 120->->->->145, strn8880f"Line" nam94"L129max_fds<< 0;
->            g14850>14516" isrbufmtat->1458a href="+cefaspanufuser" ufum"L1<>/*5ename" c* We need 6 bitmaps 4+c/out/ex=for"bothuincoming and outgoing),5ename" c* since we t 146f="+csspanufuser" ufum"L1<>5ename" c* comp-words.1465ename" c*/            g14865>146122" class="line" nam95"L129i95"a href="fs/compi95"8880f"Line" nam94"L129FDS_BYTES         >, strFDS_BYTESpat84t94#9107" i94="n         >, strn8880L"srbufmtat->146a href="+cne"ss="sroputdneedbit->->146t;->;
146f (!147f="+cEOVERFLO94="L5952 120147->147122" class="line" nam95"L129fds<< 0;
->147a href="+cne"ss="sroputdneedfds<< 0;
->     ed int 147 href="+cdiress="sroputdneedfds<< 0;
->->;
->147147f (!->              1478 >148if="+c  c=lename"ms/compat84c#L67r;
->->->;
->148 hrefsrbufmtat->->->148f (!->;
;
->}
, stri9gnal_pendingpat84lnkage" class="am94"L1-> m_14 cl>149    /a>(unsigshort1492<  =     char<      14614916" i84="L76"fd" "+code=comss=uxaom 142sm84fd_set<< 0;
->;
->;
;
->;
}
->->    /a>(unsigshort1502<  =ef="+cEFAULTLULT" class=15r7ct     char<      15r15016" isrbufmtat->;
;
             >, struct __use15use>151if="+c  c=lenclass="line" nam95"L10eom 142timeval             >, struct 151ef="+cd_rec=lclass="line" nam95"L10timespec->151122" class="lclass="line" nam95"L10eom 142timeval->(151g ->151             >, strcopy_from>    pat84"srfilnuser                15 11>151->->                ret- >152ef="+cd_rec=lename" cename" came" claline" nam95"L10tv152g       15m95>152                    g15/a>>15216" i84="L76" class="line" nr->->->            g15932>153153a href="+cne"ss="sroputdneedeom 142ucompat<< 0;
, strn8880"srbufmtat->            g15930>153 href="+cdiress="sroputdneedeom 142uptrat<< 0;
->153->            g15930>15316" i84="L76" class="line" neom 142uptrat<< 0;
->->            g15931>153f (!<}"srbufmtat->154eputdsrbufmtat->             >, struct ->154a hresrbufmtat->154             >, strcopy_from>    pat84"srfilnuser->        154"L>15416" i84="L76"fd" clalnkage" class="eom 142sys_select<< 0;
;
->}
155eputdsrbufmtat->155f="+c95="L9=compat94#9107" i94="do_eom 142paelect<< 0;
             >, struct              >, struct 155(unsig/a15   >155->            g15850>15516" i84="L76" class="line" nsigsm84t<< 0;
->1558a href="+cefclass="line" nam95"L10eom 142timespec->15ss=>155f (!->->156f="+csrbufmtat->156            g15865>156122" class="la href="fd" "+code=comss=uxaopy_from>             >, strcopy_from>    pat84"srfilnuser156g ->->156t;;
156f (!157eputdsrbufmtat->157f="+cEOVERFLO+ulms/compat84c#L67i9gmasks="line" nam95"sigmask" naeat95#4103" i95"L124" clas1572ct 157122" class="la href="+cfilnkafd" class="srfilnuser0n   = 157g              >, strcopy_from>    pat84"srfilnuser     ed int 157 href="+cdirea href="+cfilnkafd" class="srfilnuser0n FAULTa href="+cbufuseFAULTfmta"srbufmtat->-><<< 0;
->;
->157, strSIGSTOPa hreL"srbufmtat->157f (!, strSIG_SETMASK" na ""srfilnuser->              1578 >158if="+c  c=lenef="+cEFAULTLULT" class=1581ct ;
->->->;
edirud15s=">158;
/*ccccccccccccccccc* Don't restore the i9gnal mask yet. Let do2a9gnal() deliv  paspan= ccccccccccccccccc* the i9gnal on the way back to     space, before the i9gnalpaspan= 5ename" ccccccccc* mask is restored.5ename" ccccccccc*/;
}
->->    /a>(unsigshort159    char<      156159t;, strSIG_SETMASK" na ""srfilnuser->;
;
->;
;
->}
             >, struct              >, struct              >, struct     /a>(unsigshort160160127" f="+cEFAULTLULT" class=16r9ct ;
__use16use>161if="+c  c=lena href="+ulmclass="sroputdneaccess_oks="line" nam95"access_ok" na4ine" nam94"L129VERIFY_READ;
161ef="+cd_rec=lename" cclass="line" nam95"L129_2am84             >, strucam84    " na4ine" nam94"L129upa href="fs/compupa hr," "+code=comss=uxaom 142uptrat<< 0;
             >, struct ->161122" class="la href="+cfilnkaine" nam95"L129_2am84             >, strucam84    " na4ine" nam94"L129sigsm8i95"a href="fs/compi9gsm8i95"a hr 4="L90" class="line" na1614ct (161a href="+cne"WLULT" cclass="lllllllll4ine" nam94"L129eom 142size4t<< 0;
             >, struct ->161                16 11>161->162f="+cs="srne"=lestatasmrefkage             >, struct              >, struct 162122" class="lcons="line" nam95"L10eom 142sigsm84t<< 0;
             >, struct 162g       16m95>162 href="+cdiress="sroputdneedeom 142sigsm84t<< 0;
->->                    g16/a>>16216" i84="L76"class="line" nam95"L10eom 142timespec1628a href="+cefclass="line" nam95"L10timespec->->             >, strcopy_from>    pat84"srfilnuser            g16935>163122" class="la href="+cfilnkafd" class="srfilnuser0n FAULTa href="+cbufuseFAULTfmta"srbufmtat->163a hresrbufmtat->            g16930>163 href="+cdirea href="94="L5952 120->163            g16930>163t;163            g16931>163->1640a href="+cneaulm94="L5952 120             >, strcopy_from>    pat84"srfilnuser164g ->164 href="+cdirea href="94="L5952 120-><<< 0;
->        164"L>164t;, strSIGSTOPa hreL"srbufmtat->;
, strSIG_SETMASK" na ""srfilnuser->}
165eputdsrbufmtat->165f="+cEOVERFLOlnkage" class="r->/* We canurestart this ayscall, usuallyc*/165 href="+cdirea href="9spanufuser" ufum"L1<>/*(unsig/a16   >165ccccccccccccccccc* Don't restore the i9gnal mask yet. Let do2a9gnal() deliv  paspan=             g16850>16516" iccccccccccccccccc* the i9gnal on the way back to     space, before the i9gnalpaspan= 165ccccccccccccccccc* mask is restored.5ename" ccccccccc*/166f="+cEOVERFLOWLULT" ccccccccc94="L5952 120166ef="+cd_rec=lename" cclass="llllllllli95"of4ine" nam94"L129sigsavehref="+cfilnkagesigsaveh"+cdLL"srbufmtat->            g16865>166122" class="la href="cccccccc94="L5952 120->166g ;
->166t;, strSIG_SETMASK" na ""srfilnuser->;
}
->167eputdsrbufmtat->167f="+cEOVERFLOfd" clalnkage" class="r->167122" f="+cEFAULTLULT" class=1674ct 167g      ed int 167 hrefsrbufmtat->;
             >, struct 167167f (!             >, struct               1678 >168if="+c  c=lena href="a href="lnuser;
->->;
->168 hrefsrbufmtat->/*ccccccccc* If the caller waL1s a certain i9gnal mask to be set during the wait,ccccccccc* we apply it here.5ename" c*/;
}
169122" class="la href="fd" "+code=comss=uxaopy_from>             >, strcopy_from>    pat84"srfilnuser->-><<< 0;
->    /a>(unsigshort169, strSIGSTOPa hreL"srbufmtat->    char<      166169t;, strSIG_SETMASK" na ""srfilnuser->;
;
1700a href="+cnet94#9107" i94="er          >, strer nam95=ilnkage" class="sys_epoll_wait<< 0;
->;
->}
/*ccccccccc* If we changed the i9gnal mask, we need to restore the original one.ccccccccc* Inufase we've got a i9gnal while waiting, we do not restore theccccccccc* i9gnal mask yet, and we allow do2a9gnal() to deliv   the i9gnal on    /a>(unsigshort170ccccccccc* the way back to     space, before the i9gnal mask is restored.    char<      17r17016" iccccccccc*/;
;
__use17use>171if="+c  c=lena href="ef="+cnet94#9107" i94="memcpys="line" nam95"memcpypat84"srfilnuser->171ef="+cd_rec=lename" cclass="line" nam95"L129sm84restore_i9gmasks="line" nam95"sm84restore_i9gmaskpat84L"srbufmtat->171122" class="la href="} elsmsrbufmtat->(171a href="+cne"WLULT" cclass="l"+code=comss=uxsigprocmasks="line" nam95"sigprocmask" na4ine" nam94"L129SIG_SETMASK         >, strSIG_SETMASK" na ""srfilnuser->1712<  = ->                17 11>171/* CONFIG_EPOL->                ret- >172ef="+#ifdefalnkage" class="CONFIG_SIGNALFD;
->172g       17m95>172 href="+cdirea href="+cfilnkaaaaaaaaaaaaaacons="line" nam95"L10eom 142sigsm84t<< 0;
             >, struct                     g17/a>>17216" it95#4103" i95"L124" clas17_8ct ->->->            g17932>173f="+csrbufmtat->            g17935>173122" class="la href="fd" class="srfilnuser0n   = 173a href="+cne"fd" "+code=comss=uxaopy_from>             >, strcopy_from>    pat84"srfilnuser            g17930>173 href="+cdirea href="fd" class="srfilnuser0n FAULTa href="+cbufuseFAULTfmta"srbufmtat->173-><<< 0;
->            g17930>17316" i84="L76" class="line" nksigmasks="line" nam95"ksigmask" na5=ilnkage" class="eom 142alloc>    _space<< 0;
->            g17931>173f (!->174eputdsrbufmtat->->174g 174 href="+cdirea href="""""""""""""""""""""cons="line" nam95"L10eom 142sigsm84t<< 0;
             >, struct         174"L>17416" it95#4103" i95"L124" clas1748ct ;
->}
175eputd#endaulsspanufuser" ufum"L1<>/* CONFIG_SIGNALFDc*/175f="+csrbufmtat->175 href="+cdirea href=""""""""""""""""""""cons="class="line" nam95"L10eom 142itimerspec             >, struct , strutm a hr 4="L90" class="line" na1756ct (unsig/a17   >175             >, struct , strotm a hre4="L90" class="line" na17d7ct             g17850>17516" it95#4103" i95"L124" clas17d8ct 175->->             >, struct , strutnam9"srbufmtat->176f="+csrbufmtat->176ef="+cd_rec=l+ulms/compat84c#L67am84eom 142itimerspec, strutm a hrLe4="L90" class="line" na17s3ct             g17865>176122" class="la href="fd" class="srfilnuser0n FAULTa href="+cbufuseFAULTfmta"srbufmtat->176g , strutnam95=ilnkage" class="eom 142alloc>    _space<< 0;
->, strutnam9[0] ""srfilnuser->17616" i84="L76" class="line" nerro          >, strer o nam95=ilnkage" class="sys_timerfd2sm8time, strutnam9[0] ""srfilnuser, strutnam9[1]L"srbufmtat->;
}
, strer o nam95=ims/compat84c#L67aopy_from>             >, strcopy_from>    pat84"srfilnuser, strutnam9[1], i95"of4class="line" nam95"L10itimerspec(uns17s=">177f="+csrbufmtat->->177122" ef="+cEFAULTLULT" class=1774ct 177a hresrbufmtat->     ed int 177 hreflnkage" class="asmrefkage->             >, struct , strotm a hre4="L90" class="line" na1777ct ;
177->177f (!->              1778 >178if="+c  c=lenclass="line" nam95"L10itimerspec             >, struct , strutnam9"srbufmtat->;
->    _spacepat84i95"of4class="line" nam95"L10itimerspec->, strer o nam95=ilnkage" class="sys_timerfd2gm8time->;
178 href="+cdirea href="94="L5952 120, strer o nam95=ims/compat84c#L67aopy_from>             >, strcopy_from>    pat84"srfilnuser, strutnam9, i95"of4class="line" nam95"L10itimerspec178->179f="+c#endaulsspanufuser" ufum"L1<>/* CONFIG_TIMERFDc*/}
179122" #ifdefalnkage" class="CONFIG_FHANDLE;
 m_17 cl>179g /*c* Exactly like +cbopen.c:sys_open_by_handle_at(), except that it" span=     /a>(unsigshort179c* doesn't set the O_LARGEFILE flag.    char<      17617916" ic*/;
;
->;
             >, struct ;
}
->
The original LXR software by the ="+cEFAULhttp://sourceforge.net/projects/lx  >LXR ufumunityfmtatethis experim"L1al version by ="+cEFAULmailto:lx @de=ux.no">lx @de=ux.nofmta.
lx .de=ux.no kindly hosted by ="+cEFAULhttp://www.redpill-de=pro.no">Redpill Le=pro ASfmtateprovider of Le=ux"consulting and operations services since 1995.