fn create(
        owner: EmuFsSharedWeakPtr,
        orig_path: &OsStr,
        orig_device: dev_t,
        orig_inode: ino_t,
        orig_file_size: u64,
    ) -> EmuFileSharedPtr {
        let mut fd_and_name: Option<(ScopedFd, OsString)> =
            create_memfd_file(orig_path, orig_device, orig_inode);
        if fd_and_name.is_none() {
            fd_and_name = create_tmpfs_file(orig_path, orig_device, orig_inode);
            if fd_and_name.is_none() {
                fatal!(
                    "Failed to create shmem segment for {}:{} {:?}",
                    orig_device,
                    orig_inode,
                    orig_path
                );
            }
        }

        let (fd, real_name) = fd_and_name.unwrap();
        resize_shmem_segment(&fd, orig_file_size.try_into().unwrap());

        let f = EmuFile::new(
            owner,
            fd,
            orig_path,
            &real_name,
            orig_device,
            orig_inode,
            orig_file_size,
        );

        log!(
            LogDebug,
            "created emulated file for {:?} as {:?}",
            orig_path,
            real_name
        );

        f
    }
/// Create a new emulated file for `orig_path` that will
/// emulate the recorded attributes `est`.  `tag` is used to
/// uniquely identify this file among multiple EmuFs's that
/// might exist concurrently in this tracer process.
Create a new emulated file for `orig_path` that will
emulate the recorded attributes `est`.  `tag` is used to
uniquely identify this file among multiple EmuFs's that
might exist concurrently in this tracer process.
Create a new emulated file for ` orig_path ` that will emulate the recorded attributes ` est ` . ` tag ` is used to uniquely identify this file among multiple EmuFs ' s that might exist concurrently in this tracer process .
fn create(
        owner: EmuFsSharedWeakPtr,
        orig_path: &OsStr,
        orig_device: dev_t,
        orig_inode: ino_t,
        orig_file_size: u64,
    ) -> EmuFileSharedPtr {
        let mut fd_and_name: Option<(ScopedFd, OsString)> =
            create_memfd_file(orig_path, orig_device, orig_inode);
        if fd_and_name.is_none() {
            fd_and_name = create_tmpfs_file(orig_path, orig_device, orig_inode);
            if fd_and_name.is_none() {
                fatal!(
                    "Failed to create shmem segment for {}:{} {:?}",
                    orig_device,
                    orig_inode,
                    orig_path
                );
            }
        }
        let (fd, real_name) = fd_and_name.unwrap();
        resize_shmem_segment(&fd, orig_file_size.try_into().unwrap());
        let f = EmuFile::new(
            owner,
            fd,
            orig_path,
            &real_name,
            orig_device,
            orig_inode,
            orig_file_size,
        );
        log!(
            LogDebug,
            "created emulated file for {:?} as {:?}",
            orig_path,
            real_name
        );
        f
    }
fn create ( owner : EmuFsSharedWeakPtr , orig_path : & OsStr , orig_device : dev_t , orig_inode : ino_t , orig_file_size : u64 , ) -> EmuFileSharedPtr { let mut fd_and_name : Option < ( ScopedFd , OsString ) > = create_memfd_file ( orig_path , orig_device , orig_inode ) ; if fd_and_name . is_none ( ) { fd_and_name = create_tmpfs_file ( orig_path , orig_device , orig_inode ) ; if fd_and_name . is_none ( ) { fatal ! ( " " orig_device orig_inode orig_path ) ; } } let ( fd , real_name ) = fd_and_name . unwrap ( ) ; resize_shmem_segment ( & fd , orig_file_size . try_into ( ) . unwrap ( ) ) ; let f = EmuFile :: new ( owner , fd , orig_path , & real_name , orig_device , orig_inode , orig_file_size , ) ; log ! ( LogDebug " " orig_path real_name ) ; f }
Create a new emulated file for `orig_path` that will
emulate the recorded attributes `est`.
Create a new emulated file for ` orig_path ` that will emulate the recorded attributes ` est ` .
owner
EmuFsSharedWeakPtr
orig_path
&OsStr
orig_device
dev_t
orig_inode
ino_t
orig_file_size
u64