Skip to contentSkip to conversation

Return EOPNOTSUPP instead of ENOSYS for *xattr* syscalls

PATCH In review Arnaud Patard (Rtp) 3 participants 3 messages Apr 21, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Return EOPNOTSUPP instead of ENOSYS for *xattr* syscalls

In current code, we're sending ENOSYS to target when a syscall for the xattrs is done. This makes applications like ls complain loudly about that and breaks scripts parsing the output. Moreover, iirc, implemented features of filesystems are are sending EOPNOTSUPP (I've not checked so I may be a little bit wrong on that...).
So, I'm proposing to return -EOPNOTSUPP and make ls happy.

As a side not, I'd like to know if there's a reason for not having implemented the *xattr* syscalls support. If someone has a clue, please share it :).

---

linux-user/syscall.c +2 -1
index ec04170..a036dd4 100644
@@ -6279,7 +6279,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
     case TARGET_NR_removexattr:
     case TARGET_NR_lremovexattr:
     case TARGET_NR_fremovexattr:
-        goto unimplemented_nowarn;
+         ret = -TARGET_EOPNOTSUPP;
+	 break;
 #endif
 #ifdef TARGET_NR_set_thread_area
     case TARGET_NR_set_thread_area:
#1 lore raw
Quoted 11 lines

In current code, we're sending ENOSYS to target when a syscall for the
xattrs is done. This makes applications like ls complain loudly about that and breaks scripts parsing the output. Moreover, iirc, implemented
features of filesystems are are sending EOPNOTSUPP (I've not checked so
I may be a little bit wrong on that...).
So, I'm proposing to return -EOPNOTSUPP and make ls happy.

Quoted 4 lines

As a side not, I'd like to know if there's a reason for not having implemented the *xattr* syscalls support. If someone has a clue, please
share it :).

Possibly to avoid endianness issues with binary data ?

François.

Acked-by on v1 1/1
#2 lore raw
In reply to Arnaud Patard (Rtp)
Quoted 6 lines · Arnaud Patard

In current code, we're sending ENOSYS to target when a syscall for the xattrs is done. This makes applications like ls complain loudly about that and breaks scripts parsing the output. Moreover, iirc, implemented features of filesystems are are sending EOPNOTSUPP (I've not checked so I may be a little bit wrong on that...).
So, I'm proposing to return -EOPNOTSUPP and make ls happy.

Looks ok to me.

Quoted 3 lines

As a side not, I'd like to know if there's a reason for not having implemented the *xattr* syscalls support. If someone has a clue, please share it :).

I guess nobody has just needed extended attributes and linux-user qemu so far.

Quoted 16 lines

---

linux-user/syscall.c +2 -1
index ec04170..a036dd4 100644
@@ -6279,7 +6279,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
     case TARGET_NR_removexattr:
     case TARGET_NR_lremovexattr:
     case TARGET_NR_fremovexattr:
-        goto unimplemented_nowarn;
+         ret = -TARGET_EOPNOTSUPP;
+	 break;
 #endif
 #ifdef TARGET_NR_set_thread_area
     case TARGET_NR_set_thread_area: