* this function is a POSIX compliant version, * which will create a new file or rewrite an existing one * * @param path the path name of file. * @param mode the file permission bits to be used in creating the file (not used, can be 0) * * @return the non-negative integer on successful open, others for failed. */
| 268 | * @return the non-negative integer on successful open, others for failed. |
| 269 | */ |
| 270 | int creat(const char *path, mode_t mode) |
| 271 | { |
| 272 | return open(path, O_WRONLY | O_CREAT | O_TRUNC, mode); |
| 273 | } |
| 274 | RTM_EXPORT(creat); |
| 275 | |
| 276 | /** |