Skip to content

Commit

Permalink
[starnix][rust] Use specific names to avoid ambiguity.
Browse files Browse the repository at this point in the history
The uapi module glob use was causing a new rust lint to trigger. The
constants in uapi module were going to cause ambiguous name conflicts
due to the constants of the same names defined in the auth, errno, and
signals modules. The modules as written should not have been able to
compile, but do to a bug in the rust compiler, they did. There are more
details in rust-lang/rust#114095.

Bug: 130265
Test: fx build
Change-Id: I8605a51de353fa6c2089be3ee965737dc55b6f2a
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/898801
Fuchsia-Auto-Submit: Paul Faria <[email protected]>
Reviewed-by: Theodore Dubois <[email protected]>
Commit-Queue: Auto-Submit <[email protected]>
  • Loading branch information
Nashenas88 authored and Rebase bot committed Aug 10, 2023
1 parent 2aa5c07 commit 5dc4c54
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/starnix/kernel/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,39 @@ pub use time::*;
pub use uapi::*;
pub use user_address::*;
pub use user_buffer::*;

// Manually export names that are ambiguous between the name below and the one defined in uapi.
pub use auth::{
CAP_AUDIT_CONTROL, CAP_AUDIT_READ, CAP_AUDIT_WRITE, CAP_BLOCK_SUSPEND, CAP_BPF,
CAP_CHECKPOINT_RESTORE, CAP_CHOWN, CAP_DAC_OVERRIDE, CAP_DAC_READ_SEARCH, CAP_FOWNER,
CAP_FSETID, CAP_IPC_LOCK, CAP_IPC_OWNER, CAP_KILL, CAP_LEASE, CAP_LINUX_IMMUTABLE,
CAP_MAC_ADMIN, CAP_MAC_OVERRIDE, CAP_MKNOD, CAP_NET_ADMIN, CAP_NET_BIND_SERVICE,
CAP_NET_BROADCAST, CAP_NET_RAW, CAP_PERFMON, CAP_SETFCAP, CAP_SETGID, CAP_SETPCAP, CAP_SETUID,
CAP_SYSLOG, CAP_SYS_ADMIN, CAP_SYS_BOOT, CAP_SYS_CHROOT, CAP_SYS_MODULE, CAP_SYS_NICE,
CAP_SYS_PACCT, CAP_SYS_PTRACE, CAP_SYS_RAWIO, CAP_SYS_RESOURCE, CAP_SYS_TIME,
CAP_SYS_TTY_CONFIG, CAP_WAKE_ALARM,
};

pub use errno::{
E2BIG, EACCES, EADDRINUSE, EADDRNOTAVAIL, EADV, EAFNOSUPPORT, EAGAIN, EALREADY, EBADE, EBADF,
EBADFD, EBADMSG, EBADR, EBADRQC, EBADSLT, EBFONT, EBUSY, ECANCELED, ECHILD, ECHRNG, ECOMM,
ECONNABORTED, ECONNREFUSED, ECONNRESET, EDEADLK, EDEADLOCK, EDESTADDRREQ, EDOM, EDOTDOT,
EDQUOT, EEXIST, EFAULT, EFBIG, EHOSTDOWN, EHOSTUNREACH, EHWPOISON, EIDRM, EILSEQ, EINPROGRESS,
EINTR, EINVAL, EIO, EISCONN, EISDIR, EISNAM, EKEYEXPIRED, EKEYREJECTED, EKEYREVOKED, EL2HLT,
EL2NSYNC, EL3HLT, EL3RST, ELIBACC, ELIBBAD, ELIBEXEC, ELIBMAX, ELIBSCN, ELNRNG, ELOOP,
EMEDIUMTYPE, EMFILE, EMLINK, EMSGSIZE, EMULTIHOP, ENAMETOOLONG, ENAVAIL, ENETDOWN, ENETRESET,
ENETUNREACH, ENFILE, ENOANO, ENOBUFS, ENOCSI, ENODATA, ENODEV, ENOENT, ENOEXEC, ENOKEY, ENOLCK,
ENOLINK, ENOMEDIUM, ENOMEM, ENOMSG, ENONET, ENOPKG, ENOPROTOOPT, ENOSPC, ENOSR, ENOSTR, ENOSYS,
ENOTBLK, ENOTCONN, ENOTDIR, ENOTEMPTY, ENOTNAM, ENOTRECOVERABLE, ENOTSOCK, ENOTTY, ENOTUNIQ,
ENXIO, EOPNOTSUPP, EOVERFLOW, EOWNERDEAD, EPERM, EPFNOSUPPORT, EPIPE, EPROTO, EPROTONOSUPPORT,
EPROTOTYPE, ERANGE, EREMCHG, EREMOTE, EREMOTEIO, ERESTART, ERFKILL, EROFS, ESHUTDOWN,
ESOCKTNOSUPPORT, ESPIPE, ESRCH, ESRMNT, ESTALE, ESTRPIPE, ETIME, ETIMEDOUT, ETOOMANYREFS,
ETXTBSY, EUCLEAN, EUNATCH, EUSERS, EWOULDBLOCK, EXDEV, EXFULL,
};

pub use signals::{
SIGABRT, SIGALRM, SIGBUS, SIGCHLD, SIGCONT, SIGFPE, SIGHUP, SIGILL, SIGINT, SIGIO, SIGIOT,
SIGKILL, SIGPIPE, SIGPROF, SIGPWR, SIGQUIT, SIGRTMIN, SIGSEGV, SIGSTKFLT, SIGSTOP, SIGSYS,
SIGTERM, SIGTRAP, SIGTSTP, SIGTTIN, SIGTTOU, SIGURG, SIGUSR1, SIGUSR2, SIGVTALRM, SIGWINCH,
SIGXCPU, SIGXFSZ,
};

0 comments on commit 5dc4c54

Please sign in to comment.