Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for Stat (0.12 sec)

  1. cni/pkg/nodeagent/podcgroupns_linux.go

    // limitations under the License.
    
    package nodeagent
    
    import (
    	"fmt"
    	"io/fs"
    	"syscall"
    )
    
    func GetInode(fi fs.FileInfo) (uint64, error) {
    	if stat, ok := fi.Sys().(*syscall.Stat_t); ok {
    		return stat.Ino, nil
    	}
    	return 0, fmt.Errorf("unable to get inode")
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 814 bytes
    - Viewed (0)
  2. cni/pkg/nodeagent/netns_linux.go

    }
    
    func (n *NetnsWrapper) Close() error {
    	return n.innerNetns.Close()
    }
    
    func (n *NetnsWrapper) Fd() uintptr {
    	return n.innerNetns.Fd()
    }
    
    func inodeForFd(n NetnsFd) (uint64, error) {
    	stats := &unix.Stat_t{}
    	err := unix.Fstat(int(n.Fd()), stats)
    	return stats.Ino, err
    }
    
    func OpenNetns(nspath string) (NetnsCloser, error) {
    	n, err := netns.GetNS(nspath)
    	if err != nil {
    		return nil, err
    	}
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Wed Jan 31 10:05:36 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  3. cni/pkg/repair/netns.go

    		if err != nil {
    			log.Debugf("failed to get netns for pid %v: %v", p.PID, err)
    			continue
    		}
    
    		if id != wantID {
    			// Not the network we want, skip
    			continue
    		}
    		s, err := p.Stat()
    		if err != nil {
    			// Unexpected... we will use it, but only if we find nothing without errors
    			log.Warnf("failed to read proc %v stats: %v", p.PID, err)
    			if best == "" {
    				best = ns
    			}
    			continue
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Wed Dec 20 22:14:13 GMT 2023
    - 4.8K bytes
    - Viewed (0)
  4. cni/pkg/pluginlistener/listener.go

    	if err != nil {
    		return nil, fmt.Errorf("failed to listen on unix socket %q: %v", path, err)
    	}
    
    	// Update file permission so that cni plugin has permission to access it.
    	if _, err := os.Stat(path); err != nil {
    		return nil, fmt.Errorf("cni listener file %q doesn't exist", path)
    	}
    	if err := os.Chmod(path, 0o666); err != nil {
    		return nil, fmt.Errorf("failed to update %q permission", path)
    	}
    
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  5. cni/pkg/nodeagent/fakes_test.go

    	return f.fd
    }
    
    func (f *fakeFileFakeFds) Stat() (fs.FileInfo, error) {
    	fi, err := f.File.Stat()
    	if err != nil {
    		return nil, err
    	}
    	return &fakeFileFakeFI{FileInfo: fi}, nil
    }
    
    type fakeFileFakeFI struct {
    	fs.FileInfo
    }
    
    func (f *fakeFileFakeFI) Sys() any {
    	return &syscall.Stat_t{Ino: 1}
    }
    
    // Open opens the named file.
    Go
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 3.9K bytes
    - Viewed (0)
Back to top