avoid GNU extensions for BSD compatibility