VirtualBox

Changeset 57643 in vbox for trunk/src/VBox/Runtime/include


Ignore:
Timestamp:
Sep 7, 2015 1:47:08 PM (9 years ago)
Author:
vboxsync
Message:

IPRT: Added RTVfsIoStrmFromRTPipe (and RTPipeQueryInfo) for the purpose of making RTVfsIoStrmFromStdHandle be able to work with pipes. Mostly untested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/include/internal/pipe.h

    r56290 r57643  
    8282uint32_t    rtPipePollDone(RTPIPE hPipe, uint32_t fEvents, bool fFinalEntry, bool fHarvestEvents);
    8383
     84
     85/**
     86 * Fakes basic query info data for RTPipeQueryInfo.
     87 *
     88 * @param   pObjInfo            The output structure.
     89 * @param   enmAddAttr          The extra attribute.
     90 * @param   fReadPipe           Set if read pipe, clear if write pipe.
     91 */
     92DECLINLINE(void) rtPipeFakeQueryInfo(PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr, bool fReadPipe)
     93{
     94    RT_ZERO(*pObjInfo);
     95    if (fReadPipe)
     96        pObjInfo->Attr.fMode     = RTFS_TYPE_FIFO | RTFS_UNIX_IRUSR | RTFS_DOS_READONLY;
     97    else
     98        pObjInfo->Attr.fMode     = RTFS_TYPE_FIFO | RTFS_UNIX_IWUSR;
     99    pObjInfo->Attr.enmAdditional = enmAddAttr;
     100    switch (enmAddAttr)
     101    {
     102        case RTFSOBJATTRADD_UNIX:
     103            pObjInfo->Attr.u.Unix.cHardlinks = 1;
     104            break;
     105        case RTFSOBJATTRADD_UNIX_OWNER:
     106            pObjInfo->Attr.u.UnixOwner.uid = NIL_RTUID;
     107            break;
     108        case RTFSOBJATTRADD_UNIX_GROUP:
     109            pObjInfo->Attr.u.UnixGroup.gid = NIL_RTGID;
     110            break;
     111        case RTFSOBJATTRADD_EASIZE:
     112            break;
     113        case RTFSOBJATTRADD_32BIT_SIZE_HACK:
     114            /* shut up gcc. */
     115            break;
     116        /* no default, want warnings. */
     117    }
     118}
     119
     120
    84121RT_C_DECLS_END
    85122
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette