vbox的更動 34002 路徑 trunk/src/VBox/Runtime/r3/fs.cpp
- 時間撮記:
- 2010-11-11 下午05:16:37 (14 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Runtime/r3/fs.cpp
r33540 r34002 37 37 # define DEV_BSIZE S_BLKSIZE /** @todo bird: add DEV_BSIZE to sys/param.h on OS/2. */ 38 38 # endif 39 # include <grp.h> 40 # include <pwd.h> 39 41 #endif 40 42 … … 192 194 } 193 195 194 195 196 #ifndef RT_OS_WINDOWS 197 196 198 /** 197 199 * Internal worker function which setups RTFSOBJINFO based on a UNIX stat struct. … … 300 302 pObjInfo->Attr.u.Unix.Device = pStat->st_rdev; 301 303 } 304 305 306 /** 307 * Set user-owner additional attributes. 308 * 309 * @param pObjInfo The object info to fill add attrs for. 310 * @param uid The user id. 311 */ 312 void rtFsObjInfoAttrSetUnixOwner(PRTFSOBJINFO pObjInfo, RTUID uid) 313 { 314 pObjInfo->Attr.enmAdditional = RTFSOBJATTRADD_UNIX_OWNER; 315 pObjInfo->Attr.u.UnixOwner.uid = uid; 316 pObjInfo->Attr.u.UnixOwner.szName[0] = '\0'; 317 318 char achBuf[_4K]; 319 struct passwd Pwd; 320 struct passwd *pPwd; 321 int rc = getpwuid_r(uid, &Pwd, achBuf, sizeof(achBuf), &pPwd); 322 if (!rc && pPwd) 323 RTStrCopy(pObjInfo->Attr.u.UnixOwner.szName, sizeof(pObjInfo->Attr.u.UnixOwner.szName), pPwd->pw_name); 324 } 325 326 327 /** 328 * Set user-group additional attributes. 329 * 330 * @param pObjInfo The object info to fill add attrs for. 331 * @param gid The group id. 332 */ 333 void rtFsObjInfoAttrSetUnixGroup(PRTFSOBJINFO pObjInfo, RTUID gid) 334 { 335 pObjInfo->Attr.enmAdditional = RTFSOBJATTRADD_UNIX_GROUP; 336 pObjInfo->Attr.u.UnixGroup.gid = gid; 337 pObjInfo->Attr.u.UnixGroup.szName[0] = '\0'; 338 339 char achBuf[_4K]; 340 struct group Grp; 341 struct group *pGrp; 342 343 int rc = getgrgid_r(gid, &Grp, achBuf, sizeof(achBuf), &pGrp); 344 if (!rc && pGrp) 345 RTStrCopy(pObjInfo->Attr.u.UnixGroup.szName, sizeof(pObjInfo->Attr.u.UnixGroup.szName), pGrp->gr_name); 346 } 347 302 348 #endif /* !RT_OS_WINDOWS */ 303 349
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器