Changeset 57643 in vbox for trunk/src/VBox/Runtime/r3/posix
- Timestamp:
- Sep 7, 2015 1:47:08 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 102533
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/pipe-posix.cpp
r57358 r57643 672 672 673 673 674 RTDECL(int) RTPipeQueryInfo(RTPIPE hPipe, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAddAttr) 675 { 676 RTPIPEINTERNAL *pThis = hPipe; 677 AssertPtrReturn(pThis, 0); 678 AssertReturn(pThis->u32Magic == RTPIPE_MAGIC, 0); 679 680 rtPipeFakeQueryInfo(pObjInfo, enmAddAttr, pThis->fRead); 681 682 if (pThis->fRead) 683 { 684 int cb = 0; 685 int rc = ioctl(pThis->fd, FIONREAD, &cb); 686 if (rc >= 0) 687 pObjInfo->cbObject = cb; 688 } 689 #ifdef FIONSPACE 690 else 691 { 692 int cb = 0; 693 int rc = ioctl(pThis->fd, FIONSPACE, &cb); 694 if (rc >= 0) 695 pObjInfo->cbObject = cb; 696 } 697 #endif 698 699 /** @todo Check this out on linux, solaris and darwin... (Currently going by a 700 * FreeBSD manpage.) */ 701 struct stat St; 702 if (fstat(pThis->fd, &St)) 703 { 704 pObjInfo->cbAllocated = St.st_blksize; 705 if ( enmAddAttr == RTFSOBJATTRADD_NOTHING 706 || enmAddAttr == RTFSOBJATTRADD_UNIX) 707 { 708 pObjInfo->Attr.enmAdditional = RTFSOBJATTRADD_UNIX; 709 pObjInfo->Attr.u.Unix.INodeId = St.st_ino; 710 pObjInfo->Attr.u.Unix.INodeIdDevice = St.st_dev; 711 } 712 } 713 /** @todo error handling? */ 714 715 return VINF_SUCCESS; 716 } 717 718 674 719 int rtPipePollGetHandle(RTPIPE hPipe, uint32_t fEvents, PRTHCINTPTR phNative) 675 720 {
Note:
See TracChangeset
for help on using the changeset viewer.