[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



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().


Juergen

Attachment: OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.