Prvni ulozeni z chegewara githubu

This commit is contained in:
2023-02-25 16:13:53 +01:00
commit 01eb80dfe2
3279 changed files with 638407 additions and 0 deletions

View File

@ -0,0 +1,61 @@
/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>
/**
* This header file provides POSIX-compatible definitions of directory
* access data types. Starting with newlib 3.3, related functions are defined
* in 'dirent.h' bundled with newlib.
* See http://pubs.opengroup.org/onlinepubs/7908799/xsh/dirent.h.html
* for reference.
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Opaque directory structure
*/
typedef struct {
uint16_t dd_vfs_idx; /*!< VFS index, not to be used by applications */
uint16_t dd_rsv; /*!< field reserved for future extension */
/* remaining fields are defined by VFS implementation */
} DIR;
/**
* @brief Directory entry structure
*/
struct dirent {
ino_t d_ino; /*!< file number */
uint8_t d_type; /*!< not defined in POSIX, but present in BSD and Linux */
#define DT_UNKNOWN 0
#define DT_REG 1
#define DT_DIR 2
#if __BSD_VISIBLE
#define MAXNAMLEN 255
char d_name[MAXNAMLEN+1]; /*!< zero-terminated file name */
#else
char d_name[256];
#endif
};
DIR* opendir(const char* name);
struct dirent* readdir(DIR* pdir);
long telldir(DIR* pdir);
void seekdir(DIR* pdir, long loc);
void rewinddir(DIR* pdir);
int closedir(DIR* pdir);
int readdir_r(DIR* pdir, struct dirent* entry, struct dirent** out_dirent);
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,25 @@
// Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
int ioctl(int fd, int request, ...);
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,41 @@
#pragma once
#include_next <sys/lock.h>
#ifdef _RETARGETABLE_LOCKING
/* Actual platfrom-specific definition of struct __lock.
* The size here should be sufficient for a FreeRTOS mutex.
* This is checked by a static assertion in locks.c
*
* Note 1: this might need to be made dependent on whether FreeRTOS
* is included in the build.
*
* Note 2: the size is made sufficient for the case when
* configUSE_TRACE_FACILITY is enabled. If it is disabled,
* this definition wastes 8 bytes.
*/
struct __lock {
int reserved[23];
};
/* Compatibility definitions for the legacy ESP-specific locking implementation.
* These used to be provided by libc/sys/xtensa/sys/lock.h in newlib.
* Newer versions of newlib don't have this ESP-specific lock.h header, and are
* built with _RETARGETABLE_LOCKING enabled, instead.
*/
typedef _LOCK_T _lock_t;
void _lock_init(_lock_t *plock);
void _lock_init_recursive(_lock_t *plock);
void _lock_close(_lock_t *plock);
void _lock_close_recursive(_lock_t *plock);
void _lock_acquire(_lock_t *plock);
void _lock_acquire_recursive(_lock_t *plock);
int _lock_try_acquire(_lock_t *plock);
int _lock_try_acquire_recursive(_lock_t *plock);
void _lock_release(_lock_t *plock);
void _lock_release_recursive(_lock_t *plock);
#endif // _RETARGETABLE_LOCKING

View File

@ -0,0 +1,48 @@
// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef _ESP_PLATFORM_SYS_POLL_H_
#define _ESP_PLATFORM_SYS_POLL_H_
#define POLLIN (1u << 0) /* data other than high-priority may be read without blocking */
#define POLLRDNORM (1u << 1) /* normal data may be read without blocking */
#define POLLRDBAND (1u << 2) /* priority data may be read without blocking */
#define POLLPRI (POLLRDBAND) /* high-priority data may be read without blocking */
// Note: POLLPRI is made equivalent to POLLRDBAND in order to fit all these events into one byte
#define POLLOUT (1u << 3) /* normal data may be written without blocking */
#define POLLWRNORM (POLLOUT) /* equivalent to POLLOUT */
#define POLLWRBAND (1u << 4) /* priority data my be written */
#define POLLERR (1u << 5) /* some poll error occurred */
#define POLLHUP (1u << 6) /* file descriptor was "hung up" */
#define POLLNVAL (1u << 7) /* the specified file descriptor is invalid */
#ifdef __cplusplus
extern "C" {
#endif
struct pollfd {
int fd; /* The descriptor. */
short events; /* The event(s) is/are specified here. */
short revents; /* Events found are returned here. */
};
typedef unsigned int nfds_t;
int poll(struct pollfd *fds, nfds_t nfds, int timeout);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // _ESP_PLATFORM_SYS_POLL_H_

View File

@ -0,0 +1,30 @@
// Copyright 2018 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef __SYS_RANDOM__
#define __SYS_RANDOM__
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
ssize_t getrandom(void *buf, size_t buflen, unsigned int flags);
#ifdef __cplusplus
} // extern "C"
#endif
#endif //__SYS_RANDOM__

View File

@ -0,0 +1,23 @@
// Copyright 2020 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include_next<sys/reent.h>
/* This function is not part of the newlib API, it is defined in libc/stdio/local.h
* There is no nice way to get __cleanup member populated while avoiding __sinit,
* so extern declaration is used here.
*/
extern void _cleanup_r(struct _reent* r);

View File

@ -0,0 +1,50 @@
// Copyright 2018 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef __ESP_SYS_SELECT_H__
#define __ESP_SYS_SELECT_H__
/* Newlib 2.2.0 does not provide sys/select.h, and fd_set is defined in sys/types.h */
#include <sys/types.h>
#ifndef fd_set
#include_next <sys/select.h>
#else // fd_set
#include <sys/time.h>
#ifdef __cplusplus
extern "C" {
#endif
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *timeout);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // fd_set
#if defined(FD_ISSET) || defined(FD_SET) || defined(FD_CLR)
#undef FD_SET
#undef FD_CLR
#undef FD_ISSET
#define __FD_SAFE_SET(n, code) do { if ((unsigned)(n) < FD_SETSIZE) { code; } } while(0)
#define __FD_SAFE_GET(n, code) (((unsigned)(n) < FD_SETSIZE) ? (code) : 0)
#define FD_SET(n, p) __FD_SAFE_SET(n, ((p)->fds_bits[(n) / NFDBITS] |= (1L << ((n) % NFDBITS))))
#define FD_CLR(n, p) __FD_SAFE_SET(n, ((p)->fds_bits[(n) / NFDBITS] &= ~(1L << ((n) % NFDBITS))))
#define FD_ISSET(n, p) __FD_SAFE_GET(n, ((p)->fds_bits[(n) / NFDBITS] & (1L << ((n) % NFDBITS))))
#endif // FD_ISSET || FD_SET || FD_CLR
#endif //__ESP_SYS_SELECT_H__

View File

@ -0,0 +1,296 @@
// Copyright 2018 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// This header file is based on the termios header of
// "The Single UNIX (r) Specification, Version 2, Copyright (c) 1997 The Open Group".
#ifndef __ESP_SYS_TERMIOS_H__
#define __ESP_SYS_TERMIOS_H__
// ESP-IDF NOTE: This header provides only a compatibility layer for macros and functions defined in sys/termios.h.
// Not everything has a defined meaning for ESP-IDF (e.g. process leader IDs) and therefore are likely to be stubbed
// in actual implementations.
#include <stdint.h>
#include <sys/types.h>
#include "sdkconfig.h"
#ifdef CONFIG_VFS_SUPPORT_TERMIOS
// subscripts for the array c_cc:
#define VEOF 0 /** EOF character */
#define VEOL 1 /** EOL character */
#define VERASE 2 /** ERASE character */
#define VINTR 3 /** INTR character */
#define VKILL 4 /** KILL character */
#define VMIN 5 /** MIN value */
#define VQUIT 6 /** QUIT character */
#define VSTART 7 /** START character */
#define VSTOP 8 /** STOP character */
#define VSUSP 9 /** SUSP character */
#define VTIME 10 /** TIME value */
#define NCCS (VTIME + 1) /** Size of the array c_cc for control characters */
// input modes for use as flags in the c_iflag field
#define BRKINT (1u << 0) /** Signal interrupt on break. */
#define ICRNL (1u << 1) /** Map CR to NL on input. */
#define IGNBRK (1u << 2) /** Ignore break condition. */
#define IGNCR (1u << 3) /** Ignore CR. */
#define IGNPAR (1u << 4) /** Ignore characters with parity errors. */
#define INLCR (1u << 5) /** Map NL to CR on input. */
#define INPCK (1u << 6) /** Enable input parity check. */
#define ISTRIP (1u << 7) /** Strip character. */
#define IUCLC (1u << 8) /** Map upper-case to lower-case on input (LEGACY). */
#define IXANY (1u << 9) /** Enable any character to restart output. */
#define IXOFF (1u << 10) /** Enable start/stop input control. */
#define IXON (1u << 11) /** Enable start/stop output control. */
#define PARMRK (1u << 12) /** Mark parity errors. */
// output Modes for use as flags in the c_oflag field
#define OPOST (1u << 0) /** Post-process output */
#define OLCUC (1u << 1) /** Map lower-case to upper-case on output (LEGACY). */
#define ONLCR (1u << 2) /** Map NL to CR-NL on output. */
#define OCRNL (1u << 3) /** Map CR to NL on output. */
#define ONOCR (1u << 4) /** No CR output at column 0. */
#define ONLRET (1u << 5) /** NL performs CR function. */
#define OFILL (1u << 6) /** Use fill characters for delay. */
#define NLDLY (1u << 7) /** Select newline delays: */
#define NL0 (0u << 7) /** Newline character type 0. */
#define NL1 (1u << 7) /** Newline character type 1. */
#define CRDLY (3u << 8) /** Select carriage-return delays: */
#define CR0 (0u << 8) /** Carriage-return delay type 0. */
#define CR1 (1u << 8) /** Carriage-return delay type 1. */
#define CR2 (2u << 8) /** Carriage-return delay type 2. */
#define CR3 (3u << 8) /** Carriage-return delay type 3. */
#define TABDLY (3u << 10) /** Select horizontal-tab delays: */
#define TAB0 (0u << 10) /** Horizontal-tab delay type 0. */
#define TAB1 (1u << 10) /** Horizontal-tab delay type 1. */
#define TAB2 (2u << 10) /** Horizontal-tab delay type 2. */
#define TAB3 (3u << 10) /** Expand tabs to spaces. */
#define BSDLY (1u << 12) /** Select backspace delays: */
#define BS0 (0u << 12) /** Backspace-delay type 0. */
#define BS1 (1u << 12) /** Backspace-delay type 1. */
#define VTDLY (1u << 13) /** Select vertical-tab delays: */
#define VT0 (0u << 13) /** Vertical-tab delay type 0. */
#define VT1 (1u << 13) /** Vertical-tab delay type 1. */
#define FFDLY (1u << 14) /** Select form-feed delays: */
#define FF0 (0u << 14) /** Form-feed delay type 0. */
#define FF1 (1u << 14) /** Form-feed delay type 1. */
// Baud Rate Selection. Valid values for objects of type speed_t:
// CBAUD range B0 - B38400
#define B0 0 /** Hang up */
#define B50 1
#define B75 2
#define B110 3
#define B134 4
#define B150 5
#define B200 6
#define B300 7
#define B600 8
#define B1200 9
#define B1800 10
#define B2400 11
#define B4800 12
#define B9600 13
#define B19200 14
#define B38400 15
// CBAUDEX range B57600 - B4000000
#define B57600 16
#define B115200 17
#define B230400 18
#define B460800 19
#define B500000 20
#define B576000 21
#define B921600 22
#define B1000000 23
#define B1152000 24
#define B1500000 25
#define B2000000 26
#define B2500000 27
#define B3000000 28
#define B3500000 29
#define B4000000 30
// Control Modes for the c_cflag field:
#define CSIZE (3u << 0) /* Character size: */
#define CS5 (0u << 0) /** 5 bits. */
#define CS6 (1u << 0) /** 6 bits. */
#define CS7 (2u << 0) /** 7 bits. */
#define CS8 (3u << 0) /** 8 bits. */
#define CSTOPB (1u << 2) /** Send two stop bits, else one. */
#define CREAD (1u << 3) /** Enable receiver. */
#define PARENB (1u << 4) /** Parity enable. */
#define PARODD (1u << 5) /** Odd parity, else even. */
#define HUPCL (1u << 6) /** Hang up on last close. */
#define CLOCAL (1u << 7) /** Ignore modem status lines. */
#define CBAUD (1u << 8) /** Use baud rates defined by B0-B38400 macros. */
#define CBAUDEX (1u << 9) /** Use baud rates defined by B57600-B4000000 macros. */
#define BOTHER (1u << 10) /** Use custom baud rates */
// Local Modes for c_lflag field:
#define ECHO (1u << 0) /** Enable echo. */
#define ECHOE (1u << 1) /** Echo erase character as error-correcting backspace. */
#define ECHOK (1u << 2) /** Echo KILL. */
#define ECHONL (1u << 3) /** Echo NL. */
#define ICANON (1u << 4) /** Canonical input (erase and kill processing). */
#define IEXTEN (1u << 5) /** Enable extended input character processing. */
#define ISIG (1u << 6) /** Enable signals. */
#define NOFLSH (1u << 7) /** Disable flush after interrupt or quit. */
#define TOSTOP (1u << 8) /** Send SIGTTOU for background output. */
#define XCASE (1u << 9) /** Canonical upper/lower presentation (LEGACY). */
// Attribute Selection constants for use with tcsetattr():
#define TCSANOW 0 /** Change attributes immediately. */
#define TCSADRAIN 1 /** Change attributes when output has drained. */
#define TCSAFLUSH 2 /** Change attributes when output has drained; also flush pending input. */
// Line Control constants for use with tcflush():
#define TCIFLUSH 0 /** Flush pending input. Flush untransmitted output. */
#define TCIOFLUSH 1 /** Flush both pending input and untransmitted output. */
#define TCOFLUSH 2 /** Flush untransmitted output. */
// constants for use with tcflow():
#define TCIOFF 0 /** Transmit a STOP character, intended to suspend input data. */
#define TCION 1 /** Transmit a START character, intended to restart input data. */
#define TCOOFF 2 /** Suspend output. */
#define TCOON 3 /** Restart output. */
typedef uint8_t cc_t;
typedef uint32_t speed_t;
typedef uint16_t tcflag_t;
struct termios
{
tcflag_t c_iflag; /** Input modes */
tcflag_t c_oflag; /** Output modes */
tcflag_t c_cflag; /** Control modes */
tcflag_t c_lflag; /** Local modes */
cc_t c_cc[NCCS]; /** Control characters */
speed_t c_ispeed; /** input baud rate */
speed_t c_ospeed; /** output baud rate */
};
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Extracts the input baud rate from the input structure exactly (without interpretation).
*
* @param p input termios structure
* @return input baud rate
*/
speed_t cfgetispeed(const struct termios *p);
/**
* @brief Extracts the output baud rate from the input structure exactly (without interpretation).
*
* @param p input termios structure
* @return output baud rate
*/
speed_t cfgetospeed(const struct termios *p);
/**
* @brief Set input baud rate in the termios structure
*
* There is no effect in hardware until a subsequent call of tcsetattr().
*
* @param p input termios structure
* @param sp input baud rate
* @return 0 when successful, -1 otherwise with errno set
*/
int cfsetispeed(struct termios *p, speed_t sp);
/**
* @brief Set output baud rate in the termios structure
*
* There is no effect in hardware until a subsequent call of tcsetattr().
*
* @param p input termios structure
* @param sp output baud rate
* @return 0 when successful, -1 otherwise with errno set
*/
int cfsetospeed(struct termios *p, speed_t sp);
/**
* @brief Wait for transmission of output
*
* @param fd file descriptor of the terminal
* @return 0 when successful, -1 otherwise with errno set
*/
int tcdrain(int fd);
/**
* @brief Suspend or restart the transmission or reception of data
*
* @param fd file descriptor of the terminal
* @param action selects actions to do
* @return 0 when successful, -1 otherwise with errno set
*/
int tcflow(int fd, int action);
/**
* @brief Flush non-transmitted output data and non-read input data
*
* @param fd file descriptor of the terminal
* @param select selects what should be flushed
* @return 0 when successful, -1 otherwise with errno set
*/
int tcflush(int fd, int select);
/**
* @brief Gets the parameters of the terminal
*
* @param fd file descriptor of the terminal
* @param p output termios structure
* @return 0 when successful, -1 otherwise with errno set
*/
int tcgetattr(int fd, struct termios *p);
/**
* @brief Get process group ID for session leader for controlling terminal
*
* @param fd file descriptor of the terminal
* @return process group ID when successful, -1 otherwise with errno set
*/
pid_t tcgetsid(int fd);
/**
* @brief Send a break for a specific duration
*
* @param fd file descriptor of the terminal
* @param duration duration of break
* @return 0 when successful, -1 otherwise with errno set
*/
int tcsendbreak(int fd, int duration);
/**
* @brief Sets the parameters of the terminal
*
* @param fd file descriptor of the terminal
* @param optional_actions optional actions
* @param p input termios structure
* @return 0 when successful, -1 otherwise with errno set
*/
int tcsetattr(int fd, int optional_actions, const struct termios *p);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // CONFIG_VFS_SUPPORT_TERMIOS
#endif //__ESP_SYS_TERMIOS_H__

View File

@ -0,0 +1,17 @@
#pragma once
/* Newlib sys/time.h defines timerisset, timerclear, timercmp, timeradd, timersub macros
for __CYGWIN__ and __rtems__. We want to define these macros in IDF as well.
Since we wish to use un-modified newlib headers until a patched newlib version is
available, temporarily define __rtems__ here before including sys/time.h.
__rtems__ is chosen instead of __CYGWIN__ since there are no other checks in sys/time.h
which depend on __rtems__.
Also, so that __rtems__ define does not affect other headers included from sys/time.h,
we include them here in advance (_ansi.h and sys/types.h).
*/
#include <_ansi.h>
#include <sys/types.h>
#define __rtems__
#include_next <sys/time.h>
#undef __rtems__

View File

@ -0,0 +1,24 @@
/*
* SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdint.h>
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
struct iovec;
int writev(int s, const struct iovec *iov, int iovcnt);
ssize_t readv(int fd, const struct iovec *iov, int iovcnt);
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,24 @@
// Copyright 2018 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef _ESP_PLATFORM_SYS_UN_H_
#define _ESP_PLATFORM_SYS_UN_H_
#define AF_UNIX 1 /* local to host (pipes) */
struct sockaddr_un {
short sun_family; /*AF_UNIX*/
char sun_path[108]; /*path name */
};
#endif // _ESP_PLATFORM_SYS_UN_H_

View File

@ -0,0 +1,31 @@
// Copyright 2018 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef _ESP_SYS_UNISTD_H
#define _ESP_SYS_UNISTD_H
#ifdef __cplusplus
extern "C" {
#endif
#include_next <sys/unistd.h>
int truncate(const char *, off_t __length);
int gethostname(char *__name, size_t __len);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_UNISTD_H */

View File

@ -0,0 +1,35 @@
// Copyright 2018 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef _UTIME_H_
#define _UTIME_H_
#include <sys/time.h>
#ifdef __cplusplus
extern "C" {
#endif
struct utimbuf {
time_t actime; // access time
time_t modtime; // modification time
};
int utime(const char *path, const struct utimbuf *times);
#ifdef __cplusplus
};
#endif
#endif /* _UTIME_H_ */