...
Source file
src/os/user/lookup_plan9.go
Documentation: os/user
1
2
3
4
5 package user
6
7 import (
8 "fmt"
9 "os"
10 "syscall"
11 )
12
13
14
15
16
17 func init() {
18 userImplemented = false
19 groupImplemented = false
20 groupListImplemented = false
21 }
22
23 var (
24
25
26 userBuffer = 0
27 groupBuffer = 0
28 )
29
30 func current() (*User, error) {
31 ubytes, err := os.ReadFile("/dev/user")
32 if err != nil {
33 return nil, fmt.Errorf("user: %s", err)
34 }
35
36 uname := string(ubytes)
37
38 u := &User{
39 Uid: uname,
40 Gid: uname,
41 Username: uname,
42 Name: uname,
43 HomeDir: os.Getenv("home"),
44 }
45
46 return u, nil
47 }
48
49 func lookupUser(username string) (*User, error) {
50 return nil, syscall.EPLAN9
51 }
52
53 func lookupUserId(uid string) (*User, error) {
54 return nil, syscall.EPLAN9
55 }
56
57 func lookupGroup(groupname string) (*Group, error) {
58 return nil, syscall.EPLAN9
59 }
60
61 func lookupGroupId(string) (*Group, error) {
62 return nil, syscall.EPLAN9
63 }
64
65 func listGroups(*User) ([]string, error) {
66 return nil, syscall.EPLAN9
67 }
68
View as plain text