| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_SAFE_STRERROR_POSIX_H_ | 5 #ifndef BASE_SAFE_STRERROR_POSIX_H_ |
| 6 #define BASE_SAFE_STRERROR_POSIX_H_ | 6 #define BASE_SAFE_STRERROR_POSIX_H_ |
| 7 #pragma once | |
| 8 | 7 |
| 9 #include <string> | 8 #include <string> |
| 10 | 9 |
| 11 #include "base/base_export.h" | 10 #include "base/base_export.h" |
| 12 | 11 |
| 13 // BEFORE using anything from this file, first look at PLOG and friends in | 12 // BEFORE using anything from this file, first look at PLOG and friends in |
| 14 // logging.h and use them instead if applicable. | 13 // logging.h and use them instead if applicable. |
| 15 // | 14 // |
| 16 // This file declares safe, portable alternatives to the POSIX strerror() | 15 // This file declares safe, portable alternatives to the POSIX strerror() |
| 17 // function. strerror() is inherently unsafe in multi-threaded apps and should | 16 // function. strerror() is inherently unsafe in multi-threaded apps and should |
| (...skipping 12 matching lines...) Expand all Loading... |
| 30 | 29 |
| 31 // Calls safe_strerror_r with a buffer of suitable size and returns the result | 30 // Calls safe_strerror_r with a buffer of suitable size and returns the result |
| 32 // in a C++ string. | 31 // in a C++ string. |
| 33 // | 32 // |
| 34 // Use this instead of strerror(). Note though that safe_strerror_r will be | 33 // Use this instead of strerror(). Note though that safe_strerror_r will be |
| 35 // more robust in the case of heap corruption errors, since it doesn't need to | 34 // more robust in the case of heap corruption errors, since it doesn't need to |
| 36 // allocate a string. | 35 // allocate a string. |
| 37 BASE_EXPORT std::string safe_strerror(int err); | 36 BASE_EXPORT std::string safe_strerror(int err); |
| 38 | 37 |
| 39 #endif // BASE_SAFE_STRERROR_POSIX_H_ | 38 #endif // BASE_SAFE_STRERROR_POSIX_H_ |
| OLD | NEW |