[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2 09/12] mini-os: use file_ops and get_file_from_fd() for console
Juergen Gross, le mer. 12 janv. 2022 08:57:07 +0100, a ecrit: > On 11.01.22 21:35, Samuel Thibault wrote: > > Juergen Gross, le mar. 11 janv. 2022 16:12:12 +0100, a ecrit: > > > +static int consfront_fstat(int fd, struct stat *buf) > > > +{ > > > + struct file *file = get_file_from_fd(fd); > > > + > > > + buf->st_mode = S_IRUSR | S_IWUSR; > > > + buf->st_mode |= (file->type == FTYPE_CONSOLE) ? S_IFCHR : S_IFREG; > > > + buf->st_atime = buf->st_mtime = buf->st_ctime = time(NULL); > > > + > > > + return 0; > > > +} > > > > This seems to be missing filling st_uid, st_gid, etc.? > > Not really. Those are set to zero via the call of init_stat() > in fstat(). Ah, I missed that call indeed. Samuel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |