added X_OPEN_SOURCE definition due strdup() use