亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? osfinfo.c

?? C標準庫源代碼,能提高對C的理解,不錯的哦
?? C
?? 第 1 頁 / 共 2 頁
字號:
        if ( flags & _O_NOINHERIT )
            fileflags |= FNOINHERIT;

        /* find out what type of file (file/device/pipe) */

        isdev = GetFileType((HANDLE)osfhandle);
        if (isdev == FILE_TYPE_UNKNOWN) {
            /* OS error */
            _dosmaperr( GetLastError() );   /* map error */
            return -1;
        }

        /* is isdev value to set flags */
        if (isdev == FILE_TYPE_CHAR)
            fileflags |= FDEV;
        else if (isdev == FILE_TYPE_PIPE)
            fileflags |= FPIPE;


        /* attempt to allocate a C Runtime file handle */

        if ( (fh = _alloc_osfhnd()) == -1 ) {
            errno = EMFILE;         /* too many open files */
            _doserrno = 0L;         /* not an OS error */
            return -1;              /* return error to caller */
        }

        /*
         * the file is open. now, set the info in _osfhnd array
         */

        _set_osfhnd(fh, osfhandle);

        fileflags |= FOPEN;     /* mark as open */

        _osfile(fh) = fileflags;    /* set osfile entry */

        _unlock_fh(fh);         /* unlock handle */

        return fh;          /* return handle */
}


#ifdef _MT

/***
*void _lock_fhandle(int fh) - lock file handle
*
*Purpose:
*       Assert the lock associated with the passed file handle.
*
*Entry:
*       int fh  - CRT file handle
*
*Exit:
*
*Exceptions:
*
*******************************************************************************/

void __cdecl _lock_fhandle (
        int fh
        )
{
        ioinfo *pio = _pioinfo(fh);

        /*
         * Make sure the lock has been initialized.
         */
        if ( pio->lockinitflag == 0 ) {

            _mlock( _LOCKTAB_LOCK );

            if ( pio->lockinitflag == 0 ) {
                InitializeCriticalSection( &(pio->lock) );
                pio->lockinitflag++;
            }

            _munlock( _LOCKTAB_LOCK);
        }

        EnterCriticalSection( &(_pioinfo(fh)->lock) );
}


/***
*void _unlock_fhandle(int fh) - unlock file handle
*
*Purpose:
*       Release the lock associated with passed file handle.
*
*Entry:
*       int fh  - CRT file handle
*
*Exit:
*
*Exceptions:
*
*******************************************************************************/

void __cdecl _unlock_fhandle (
        int fh
        )
{
        LeaveCriticalSection( &(_pioinfo(fh)->lock) );
}

#endif  /* _MT */


#else  /* _MAC */


#include <cruntime.h>
#include <errno.h>
#include <internal.h>
#include <fcntl.h>
#include <msdos.h>
#include <stdlib.h>

/***
*int _alloc_osfhnd() - get free _osfhnd[] entry
*
*Purpose:
*       Finds the first free entry in _osfhnd[], mark it in use and return
*       the index of the entry to the caller.
*
*Entry:
*       none
*
*Exit:
*       returns index of entry in fh, if successful
*       return -1, if no free entry is found in _osfhnd[].
*
*Exceptions:
*
*******************************************************************************/

int __cdecl _alloc_osfhnd(
        void
        )
{
        int fh;         /* _osfhnd[] index */

        /*
         * search _osfhnd[] for an entry that is not currently being used.
         * if one is found, mark it in use and set the _osfhandle field to
         * 0xffffffff.
         */
        for ( fh = 0 ; fh < _nfile ; fh++ ) {
            if ( (_osfile[fh] & FOPEN) == 0 ) {
                /*
                 * free entry found! initialize it and
                 * break out of the loop
                 */
                _osfhnd[fh] = (long)0xffffffff;
                break;
            }
        }

        /*
         * return the index of the previously free table entry, if one was
         * found. return -1 otherwise.
         */
        return( (fh >= _nfile) ? -1 : fh );
}


/***
*int _set_osfhnd(int fh) - set OS file handle table value
*
*Purpose:
*       If fh is in range and if _osfhnd[fh] is marked with 0xfffffff
*       then set _osfhnd[fh] to the passed value.
*
*Entry:
*       int fh -    index of _osfhnd[] entry
*       long fh     -   new value of this handle entry
*
*Exit:
*       Returns zero if successful.
*       Returns -1 and sets errno to EBADF otherwise.
*
*Exceptions:
*
*******************************************************************************/

int __cdecl _set_osfhnd (
        int fh,     /* index into _osfhnd[] (user's file handle) */
        long value
        )
{
        if ( ((unsigned)fh < (unsigned)_nfile) &&
             _osfhnd[fh] == (long)0xffffffff
           ) {
            _osfhnd[fh] = value;
            return(0);
        } else {
            errno = EBADF;      /* bad handle */
            _macerrno = 0L;     /* not an OS error */
            return -1;
        }
}


/***
*int _free_osfhnd(int fh) - free OS file handle table entry
*
*Purpose:
*       If fh is in range and if _osfhnd[fh] is in use and NOT marked
*       with 0xfffffff
*
*Entry:
*       int fh -    index of _osfhnd[] entry
*
*Exit:
*       Returns zero if successful.
*       Returns -1 and sets errno to EBADF otherwise.
*
*Exceptions:
*
*******************************************************************************/

int __cdecl _free_osfhnd (
        int fh      /* index into _osfhnd[] (user's file handle) */
        )
{
        if ( ((unsigned)fh < (unsigned)_nfile) &&
             (_osfile[fh] & FOPEN) &&
             _osfhnd[fh] != (long)0xffffffff
           ) {
            _osfhnd[fh] = (long)0xffffffff;
            return(0);
        } else {
            errno = EBADF;      /* bad handle */
            _macerrno = 0L;     /* not an OS error */
            return -1;
        }
}


/***
*long _get_osfhandle(int fh) - get OS file handle
*
*Purpose:
*       If fh is in range and if _osfhnd[fh] is marked free, return
*       _osfhnd[fh]
*
*Entry:
*       int fh -    index of _osfhnd[] entry
*
*Exit:
*       Returns the OS file handle if successful.
*       Returns -1 and sets errno to EBADF otherwise.
*
*Exceptions:
*
*******************************************************************************/

long __cdecl _get_osfhandle (
        int fh      /* index into _osfhnd[] (user's file handle) */
        )
{
        if ( ((unsigned)fh < (unsigned)_nfile) && (_osfile[fh] & FOPEN))
            return(_osfhnd[fh]);
        else {
            errno = EBADF;      /* bad handle */
            _macerrno = 0L;     /* not an OS error */
            return -1;
        }
}

/***
*int _open_osfhandle(long osfhandle, int flags) - open C Runtime file handle
*
*Purpose:
*       This function allocates a free C Runtime file handle and sets it
*       to point to the Win32 file handle specified by the first parameter.
*
*Entry:
*       long osfhandle -Win32 file handle to associate with C Runtime file handle.
*       int flags -     flags to associate with C Runtime file handle.
*
*Exit:
*       returns index of entry in fh, if successful
*       return -1, if no free entry is found in _osfhnd[].
*
*Exceptions:
*
*******************************************************************************/

int __cdecl _open_osfhandle(
        long osfhandle,
        int flags
        )
{
        int fh;
        char fileflags;         /* _osfile flags */

        /* copy relavent flags from second parameter */

        fileflags = 0;
        if ( flags & _O_RDONLY )
            fileflags |= FRDONLY;
        else if ( flags & _O_APPEND )
                fileflags |= FAPPEND;
        else if ( flags & _O_TEXT )
                fileflags |= FTEXT;

        /* attempt to allocate a C Runtime file handle */

        if ( (fh = _alloc_osfhnd()) == -1 ) {
            errno = EMFILE;     /* too many open files */
            _macerrno = 0L;         /* not an OS error */
            return -1;      /* return error to caller */
        }

        /*
         * the file is open. now, set the info in _osfhnd array
         */

        _set_osfhnd(fh, osfhandle);

        fileflags |= FOPEN;     /* mark as open */

        _osfile[fh] = fileflags;    /* set osfile entry */

        return fh;          /* return handle */
}


#endif  /* _MAC */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久99久久久精品网站| 午夜视频在线观看一区二区| 一区二区三区在线视频免费观看| 偷拍与自拍一区| 成人污视频在线观看| 日韩欧美中文一区| 亚洲乱码中文字幕| 国产精品99久久久久久似苏梦涵| 欧美日韩国产小视频在线观看| 国产精品视频一二| 国产精品456露脸| 日韩一区国产二区欧美三区| 一区二区高清视频在线观看| 国产成都精品91一区二区三| 欧美www视频| 亚洲成av人片在线观看| 99久久综合国产精品| 久久综合色婷婷| 久久91精品国产91久久小草| 精品视频999| 亚洲综合丝袜美腿| 一本大道av一区二区在线播放| 国产精品私人影院| 国产精品一二三区| 精品国产伦一区二区三区观看方式 | av电影在线观看一区| 久久蜜臀精品av| 国产一区二区三区四区五区入口 | 曰韩精品一区二区| 色噜噜久久综合| 日韩毛片在线免费观看| 成人国产精品免费观看| 中文字幕精品一区| 99在线精品一区二区三区| 国产精品天天摸av网| 成人高清伦理免费影院在线观看| 国产亚洲综合色| 丁香另类激情小说| 亚洲三级免费观看| 欧美色视频在线观看| 日韩在线卡一卡二| 欧美tk—视频vk| 国产69精品一区二区亚洲孕妇| 国产精品色婷婷久久58| 91蜜桃在线观看| 亚洲影视在线播放| 制服丝袜一区二区三区| 久久国产精品一区二区| 国产欧美日本一区视频| av午夜一区麻豆| 一区二区成人在线| 日韩欧美国产wwwww| 国产成人精品免费一区二区| 国产精品乱人伦中文| 一本久久a久久免费精品不卡| 亚洲综合免费观看高清完整版在线| 欧美在线观看视频一区二区| 久热成人在线视频| 国产精品色噜噜| 欧美精品视频www在线观看| 麻豆精品国产91久久久久久| 国产日韩高清在线| 91黄视频在线观看| 免费看欧美女人艹b| 日本一区二区综合亚洲| 欧美在线不卡一区| 国产精品自产自拍| 亚洲国产精品麻豆| 精品国产一区二区三区四区四| 成人精品视频网站| 日韩国产高清影视| 国产精品毛片久久久久久久| 欧美群妇大交群中文字幕| 国产不卡视频一区| 天天综合网天天综合色| 中文字幕在线观看不卡| 日韩美女在线视频| 色噜噜狠狠色综合欧洲selulu| 麻豆高清免费国产一区| 依依成人综合视频| 欧美精品一区二区三区很污很色的| 在线观看免费亚洲| 成人中文字幕合集| 毛片av一区二区三区| 亚洲精品国产高清久久伦理二区| 2023国产精华国产精品| 91精品一区二区三区在线观看| 99国产欧美另类久久久精品| 激情综合亚洲精品| 日韩国产在线一| 亚洲最大成人综合| 日韩美女视频一区| 国产丝袜欧美中文另类| 欧美不卡视频一区| 欧美日韩国产高清一区二区三区| 99久久精品国产毛片| 国产一区二区三区四区五区美女| 日韩精品亚洲一区| 亚洲韩国精品一区| 亚洲午夜影视影院在线观看| 亚洲色图都市小说| 国产精品久久久久久妇女6080| 久久久久久97三级| 国产调教视频一区| 久久久91精品国产一区二区三区| 91精品国产入口在线| 欧美日韩日日夜夜| 欧美系列亚洲系列| 在线免费观看视频一区| 色婷婷综合久色| 欧美在线观看你懂的| 色久优优欧美色久优优| 色综合久久久久久久久久久| www.久久精品| 色综合一个色综合| 97精品国产露脸对白| 一本色道久久综合狠狠躁的推荐 | 99精品欧美一区| 成人免费看的视频| 91亚洲国产成人精品一区二区三| 99视频在线精品| 色哟哟国产精品免费观看| 色欲综合视频天天天| 欧美体内she精视频| 欧美人妖巨大在线| 日韩欧美在线影院| 国产婷婷色一区二区三区四区| 亚洲国产岛国毛片在线| 亚洲精选免费视频| 天天爽夜夜爽夜夜爽精品视频| 免费在线欧美视频| 国模大尺度一区二区三区| 国产一区二区伦理片| 成人福利在线看| 在线观看成人小视频| 日韩一二三四区| 国产亚洲一本大道中文在线| 中文字幕日本不卡| 亚洲观看高清完整版在线观看| 日韩一区欧美二区| 国产999精品久久久久久 | 国产精品1024| 91美女在线观看| 欧美一区二区三区免费观看视频| 26uuu久久天堂性欧美| 国产精品久久看| 三级影片在线观看欧美日韩一区二区| 捆绑紧缚一区二区三区视频| 成人小视频免费在线观看| 在线观看日产精品| 精品va天堂亚洲国产| 亚洲欧美色一区| 久久成人羞羞网站| 91在线观看高清| 精品国精品国产尤物美女| 亚洲欧美日韩在线| 激情欧美日韩一区二区| 日本精品视频一区二区三区| 欧美va亚洲va在线观看蝴蝶网| 亚洲天天做日日做天天谢日日欢| 麻豆91在线观看| 欧美吞精做爰啪啪高潮| 国产欧美一区在线| 奇米在线7777在线精品| 97久久超碰国产精品电影| 精品国产一区二区三区久久影院| 一区二区三区自拍| 不卡电影一区二区三区| 欧美xfplay| 日本一不卡视频| 91亚洲国产成人精品一区二三 | 成人黄色电影在线 | 欧美一区二区三区成人| 综合在线观看色| 国产一区二区在线免费观看| 欧美日韩你懂得| 亚洲日本va在线观看| 国产成人小视频| 精品动漫一区二区三区在线观看| 一区二区三区中文字幕电影| av网站一区二区三区| 国产日产欧美一区二区三区| 久久精品国产77777蜜臀| 5566中文字幕一区二区电影| 亚洲在线视频免费观看| 一本大道综合伊人精品热热 | 色婷婷久久久亚洲一区二区三区| 国产视频一区在线播放| 国产一区 二区| 精品国产乱码久久久久久蜜臀| 爽好久久久欧美精品| 91国产福利在线| 亚洲自拍偷拍麻豆| 在线中文字幕一区二区| 亚洲精品欧美综合四区| 色婷婷久久久久swag精品| 亚洲欧美日韩久久精品| 在线中文字幕不卡| 亚洲国产综合色| 91麻豆精品国产91久久久更新时间 |