errno for in-kernel syscalls not SMP safe

From: Ulrich Weigand (
Date: Tue Jul 31 2001 - 11:28:16 EST


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:

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to More majordomo info at Please read the FAQ at

This archive was generated by hypermail 2b29 : Tue Jul 31 2001 - 21:00:52 EST