errno for in-kernel syscalls not SMP safe

Ulrich Weigand (Ulrich.Weigand@de.ibm.com)
Tue, 31 Jul 2001 18:28:16 +0200


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: Ulrich.Weigand@de.ibm.com

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/