1 /* 2 * Copyright (c) 2022 Meta 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #include <errno.h> 8 #include <stdio.h> 9 #include <string.h> 10 11 /* 12 * See https://pubs.opengroup.org/onlinepubs/9699919799/functions/perror.html 13 */ perror(const char * s)14void perror(const char *s) 15 { 16 fprintf(stderr, "%s%s%s\n", s == NULL ? "" : s, s == NULL ? "" : ": ", 17 strerror(errno)); 18 } 19