2001-07-31 16:29:21

by Ulrich Weigand

[permalink] [raw]
Subject: errno for in-kernel syscalls not SMP safe

Hi,

we just noticed that the 'errno' variable used for in-kernel
syscalls (linux/unistd.h) is not SMP safe.

What would you suggest is the proper way to fix this?

- Use a per-CPU (or maybe per-task) errno value?
- Protect all errno uses with a lock?
- Don't use errno at all, return negative error codes directly?
- anything else I've overlooked?


Mit freundlichen Gruessen / Best Regards

Ulrich Weigand

--
Dr. Ulrich Weigand
Linux for S/390 Design & Development
IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
Phone: +49-7031/16-3727 --- Email: [email protected]