Mistake on this page?
Report an issue in GitHub or email us
mbed_retarget.h
1 /*
2  * mbed Microcontroller Library
3  * Copyright (c) 2006-2016 ARM Limited
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef RETARGET_H
20 #define RETARGET_H
21 
22 #if __cplusplus
23 #include <cstdio>
24 #else
25 #include <stdio.h>
26 #endif //__cplusplus
27 #include <stdint.h>
28 #include <stddef.h>
29 
30 /* Include logic for errno so we can get errno defined but not bring in error_t,
31  * including errno here prevents an include later, which would redefine our
32  * error codes
33  */
34 #ifndef __error_t_defined
35 #define __error_t_defined 1
36 #include <errno.h>
37 #undef __error_t_defined
38 #else
39 #include <errno.h>
40 #endif
41 
42 /* We can get the following standard types from sys/types for gcc, but we
43  * need to define the types ourselves for the other compilers that normally
44  * target embedded systems */
45 typedef signed int ssize_t; ///< Signed size type, usually encodes negative errors
46 typedef signed long off_t; ///< Offset in a data stream
47 typedef unsigned int nfds_t; ///< Number of file descriptors
48 typedef unsigned long long fsblkcnt_t; ///< Count of file system blocks
49 #if defined(__ARMCC_VERSION) || !defined(__GNUC__)
50 typedef unsigned int mode_t; ///< Mode for opening files
51 typedef unsigned int dev_t; ///< Device ID type
52 typedef unsigned long ino_t; ///< File serial number
53 typedef unsigned int nlink_t; ///< Number of links to a file
54 typedef unsigned int uid_t; ///< User ID
55 typedef unsigned int gid_t; ///< Group ID
56 #endif
57 
58 /* Flags for open() and fcntl(GETFL/SETFL)
59  * At present, fcntl only supports reading and writing O_NONBLOCK
60  */
61 #define O_RDONLY 0 ///< Open for reading
62 #define O_WRONLY 1 ///< Open for writing
63 #define O_RDWR 2 ///< Open for reading and writing
64 #define O_NONBLOCK 0x0004 ///< Non-blocking mode
65 #define O_APPEND 0x0008 ///< Set file offset to end of file prior to each write
66 #define O_CREAT 0x0200 ///< Create file if it does not exist
67 #define O_TRUNC 0x0400 ///< Truncate file to zero length
68 #define O_EXCL 0x0800 ///< Fail if file exists
69 #define O_BINARY 0x8000 ///< Open file in binary mode
70 
71 #define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
72 
73 #define NAME_MAX 255 ///< Maximum size of a name in a file path
74 
75 #define STDIN_FILENO 0
76 #define STDOUT_FILENO 1
77 #define STDERR_FILENO 2
78 
79 #include <time.h>
80 
81 /** \addtogroup platform */
82 /** @{*/
83 /**
84  * \defgroup platform_retarget Retarget functions
85  * @{
86  */
87 
88 /* DIR declarations must also be here */
89 #if __cplusplus
90 namespace mbed {
91 
92 class FileHandle;
93 class DirHandle;
94 
95 /** Targets may implement this to change stdin, stdout, stderr.
96  *
97  * If the application hasn't provided mbed_override_console, this is called
98  * to give the target a chance to specify a FileHandle for the console.
99  *
100  * If this is not provided or returns NULL, the console will be:
101  * - UARTSerial if configuration option "platform.stdio-buffered-serial" is
102  * true and the target has DEVICE_SERIAL;
103  * - Raw HAL serial via serial_getc and serial_putc if
104  * "platform.stdio-buffered-serial" is false and the target has DEVICE_SERIAL;
105  * - stdout/stderr will be a sink and stdin will input a stream of 0s if the
106  * target does not have DEVICE_SERIAL.
107  *
108  * @param fd file descriptor - STDIN_FILENO, STDOUT_FILENO or STDERR_FILENO
109  * @return pointer to FileHandle to override normal stream otherwise NULL
110  */
111 FileHandle *mbed_target_override_console(int fd);
112 
113 /** Applications may implement this to change stdin, stdout, stderr.
114  *
115  * This hook gives the application a chance to specify a custom FileHandle
116  * for the console.
117  *
118  * If this is not provided or returns NULL, the console will be specified
119  * by mbed_target_override_console, else will default to serial - see
120  * mbed_target_override_console for more details.
121  *
122  * Example:
123  * @code
124  * FileHandle* mbed::mbed_override_console(int) {
125  * static UARTSerial my_serial(D0, D1);
126  * return &my_serial;
127  * }
128  * @endcode
129 
130  * @param fd file descriptor - STDIN_FILENO, STDOUT_FILENO or STDERR_FILENO
131  * @return pointer to FileHandle to override normal stream otherwise NULL
132  */
133 FileHandle *mbed_override_console(int fd);
134 
135 }
136 
137 typedef mbed::DirHandle DIR;
138 #else
139 typedef struct Dir DIR;
140 #endif
141 
142 /* The intent of this section is to unify the errno error values to match
143  * the POSIX definitions for the GCC_ARM, ARMCC and IAR compilers. This is
144  * necessary because the ARMCC/IAR errno.h, or sys/stat.h are missing some
145  * symbol definitions used by the POSIX filesystem API to return errno codes.
146  * Note also that ARMCC errno.h defines some symbol values differently from
147  * the GCC_ARM/IAR/standard POSIX definitions. The definitions guard against
148  * this and future changes by changing the symbol definition as shown below.
149  */
150 #undef EPERM
151 #define EPERM 1 /* Operation not permitted */
152 #undef ENOENT
153 #define ENOENT 2 /* No such file or directory */
154 #undef ESRCH
155 #define ESRCH 3 /* No such process */
156 #undef EINTR
157 #define EINTR 4 /* Interrupted system call */
158 #undef EIO
159 #define EIO 5 /* I/O error */
160 #undef ENXIO
161 #define ENXIO 6 /* No such device or address */
162 #undef E2BIG
163 #define E2BIG 7 /* Argument list too long */
164 #undef ENOEXEC
165 #define ENOEXEC 8 /* Exec format error */
166 #undef EBADF
167 #define EBADF 9 /* Bad file number */
168 #undef ECHILD
169 #define ECHILD 10 /* No child processes */
170 #undef EAGAIN
171 #define EAGAIN 11 /* Try again */
172 #undef ENOMEM
173 #define ENOMEM 12 /* Out of memory */
174 #undef EACCES
175 #define EACCES 13 /* Permission denied */
176 #undef EFAULT
177 #define EFAULT 14 /* Bad address */
178 #undef ENOTBLK
179 #define ENOTBLK 15 /* Block device required */
180 #undef EBUSY
181 #define EBUSY 16 /* Device or resource busy */
182 #undef EEXIST
183 #define EEXIST 17 /* File exists */
184 #undef EXDEV
185 #define EXDEV 18 /* Cross-device link */
186 #undef ENODEV
187 #define ENODEV 19 /* No such device */
188 #undef ENOTDIR
189 #define ENOTDIR 20 /* Not a directory */
190 #undef EISDIR
191 #define EISDIR 21 /* Is a directory */
192 #undef EINVAL
193 #define EINVAL 22 /* Invalid argument */
194 #undef ENFILE
195 #define ENFILE 23 /* File table overflow */
196 #undef EMFILE
197 #define EMFILE 24 /* Too many open files */
198 #undef ENOTTY
199 #define ENOTTY 25 /* Not a typewriter */
200 #undef ETXTBSY
201 #define ETXTBSY 26 /* Text file busy */
202 #undef EFBIG
203 #define EFBIG 27 /* File too large */
204 #undef ENOSPC
205 #define ENOSPC 28 /* No space left on device */
206 #undef ESPIPE
207 #define ESPIPE 29 /* Illegal seek */
208 #undef EROFS
209 #define EROFS 30 /* Read-only file system */
210 #undef EMLINK
211 #define EMLINK 31 /* Too many links */
212 #undef EPIPE
213 #define EPIPE 32 /* Broken pipe */
214 #undef EDOM
215 #define EDOM 33 /* Math argument out of domain of func */
216 #undef ERANGE
217 #define ERANGE 34 /* Math result not representable */
218 #undef EDEADLK
219 #define EDEADLK 35 /* Resource deadlock would occur */
220 #undef ENAMETOOLONG
221 #define ENAMETOOLONG 36 /* File name too long */
222 #undef ENOLCK
223 #define ENOLCK 37 /* No record locks available */
224 #undef ENOSYS
225 #define ENOSYS 38 /* Function not implemented */
226 #undef ENOTEMPTY
227 #define ENOTEMPTY 39 /* Directory not empty */
228 #undef ELOOP
229 #define ELOOP 40 /* Too many symbolic links encountered */
230 #undef EWOULDBLOCK
231 #define EWOULDBLOCK EAGAIN /* Operation would block */
232 #undef ENOMSG
233 #define ENOMSG 42 /* No message of desired type */
234 #undef EIDRM
235 #define EIDRM 43 /* Identifier removed */
236 #undef ECHRNG
237 #define ECHRNG 44 /* Channel number out of range */
238 #undef EL2NSYNC
239 #define EL2NSYNC 45 /* Level 2 not synchronized */
240 #undef EL3HLT
241 #define EL3HLT 46 /* Level 3 halted */
242 #undef EL3RST
243 #define EL3RST 47 /* Level 3 reset */
244 #undef ELNRNG
245 #define ELNRNG 48 /* Link number out of range */
246 #undef EUNATCH
247 #define EUNATCH 49 /* Protocol driver not attached */
248 #undef ENOCSI
249 #define ENOCSI 50 /* No CSI structure available */
250 #undef EL2HLT
251 #define EL2HLT 51 /* Level 2 halted */
252 #undef EBADE
253 #define EBADE 52 /* Invalid exchange */
254 #undef EBADR
255 #define EBADR 53 /* Invalid request descriptor */
256 #undef EXFULL
257 #define EXFULL 54 /* Exchange full */
258 #undef ENOANO
259 #define ENOANO 55 /* No anode */
260 #undef EBADRQC
261 #define EBADRQC 56 /* Invalid request code */
262 #undef EBADSLT
263 #define EBADSLT 57 /* Invalid slot */
264 #undef EDEADLOCK
265 #define EDEADLOCK EDEADLK /* Resource deadlock would occur */
266 #undef EBFONT
267 #define EBFONT 59 /* Bad font file format */
268 #undef ENOSTR
269 #define ENOSTR 60 /* Device not a stream */
270 #undef ENODATA
271 #define ENODATA 61 /* No data available */
272 #undef ETIME
273 #define ETIME 62 /* Timer expired */
274 #undef ENOSR
275 #define ENOSR 63 /* Out of streams resources */
276 #undef ENONET
277 #define ENONET 64 /* Machine is not on the network */
278 #undef ENOPKG
279 #define ENOPKG 65 /* Package not installed */
280 #undef EREMOTE
281 #define EREMOTE 66 /* Object is remote */
282 #undef ENOLINK
283 #define ENOLINK 67 /* Link has been severed */
284 #undef EADV
285 #define EADV 68 /* Advertise error */
286 #undef ESRMNT
287 #define ESRMNT 69 /* Srmount error */
288 #undef ECOMM
289 #define ECOMM 70 /* Communication error on send */
290 #undef EPROTO
291 #define EPROTO 71 /* Protocol error */
292 #undef EMULTIHOP
293 #define EMULTIHOP 72 /* Multihop attempted */
294 #undef EDOTDOT
295 #define EDOTDOT 73 /* RFS specific error */
296 #undef EBADMSG
297 #define EBADMSG 74 /* Not a data message */
298 #undef EOVERFLOW
299 #define EOVERFLOW 75 /* Value too large for defined data type */
300 #undef ENOTUNIQ
301 #define ENOTUNIQ 76 /* Name not unique on network */
302 #undef EBADFD
303 #define EBADFD 77 /* File descriptor in bad state */
304 #undef EREMCHG
305 #define EREMCHG 78 /* Remote address changed */
306 #undef ELIBACC
307 #define ELIBACC 79 /* Can not access a needed shared library */
308 #undef ELIBBAD
309 #define ELIBBAD 80 /* Accessing a corrupted shared library */
310 #undef ELIBSCN
311 #define ELIBSCN 81 /* .lib section in a.out corrupted */
312 #undef ELIBMAX
313 #define ELIBMAX 82 /* Attempting to link in too many shared libraries */
314 #undef ELIBEXEC
315 #define ELIBEXEC 83 /* Cannot exec a shared library directly */
316 #undef EILSEQ
317 #define EILSEQ 84 /* Illegal byte sequence */
318 #undef ERESTART
319 #define ERESTART 85 /* Interrupted system call should be restarted */
320 #undef ESTRPIPE
321 #define ESTRPIPE 86 /* Streams pipe error */
322 #undef EUSERS
323 #define EUSERS 87 /* Too many users */
324 #undef ENOTSOCK
325 #define ENOTSOCK 88 /* Socket operation on non-socket */
326 #undef EDESTADDRREQ
327 #define EDESTADDRREQ 89 /* Destination address required */
328 #undef EMSGSIZE
329 #define EMSGSIZE 90 /* Message too long */
330 #undef EPROTOTYPE
331 #define EPROTOTYPE 91 /* Protocol wrong type for socket */
332 #undef ENOPROTOOPT
333 #define ENOPROTOOPT 92 /* Protocol not available */
334 #undef EPROTONOSUPPORT
335 #define EPROTONOSUPPORT 93 /* Protocol not supported */
336 #undef ESOCKTNOSUPPORT
337 #define ESOCKTNOSUPPORT 94 /* Socket type not supported */
338 #undef EOPNOTSUPP
339 #define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
340 #undef EPFNOSUPPORT
341 #define EPFNOSUPPORT 96 /* Protocol family not supported */
342 #undef EAFNOSUPPORT
343 #define EAFNOSUPPORT 97 /* Address family not supported by protocol */
344 #undef EADDRINUSE
345 #define EADDRINUSE 98 /* Address already in use */
346 #undef EADDRNOTAVAIL
347 #define EADDRNOTAVAIL 99 /* Cannot assign requested address */
348 #undef ENETDOWN
349 #define ENETDOWN 100 /* Network is down */
350 #undef ENETUNREACH
351 #define ENETUNREACH 101 /* Network is unreachable */
352 #undef ENETRESET
353 #define ENETRESET 102 /* Network dropped connection because of reset */
354 #undef ECONNABORTED
355 #define ECONNABORTED 103 /* Software caused connection abort */
356 #undef ECONNRESET
357 #define ECONNRESET 104 /* Connection reset by peer */
358 #undef ENOBUFS
359 #define ENOBUFS 105 /* No buffer space available */
360 #undef EISCONN
361 #define EISCONN 106 /* Transport endpoint is already connected */
362 #undef ENOTCONN
363 #define ENOTCONN 107 /* Transport endpoint is not connected */
364 #undef ESHUTDOWN
365 #define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */
366 #undef ETOOMANYREFS
367 #define ETOOMANYREFS 109 /* Too many references: cannot splice */
368 #undef ETIMEDOUT
369 #define ETIMEDOUT 110 /* Connection timed out */
370 #undef ECONNREFUSED
371 #define ECONNREFUSED 111 /* Connection refused */
372 #undef EHOSTDOWN
373 #define EHOSTDOWN 112 /* Host is down */
374 #undef EHOSTUNREACH
375 #define EHOSTUNREACH 113 /* No route to host */
376 #undef EALREADY
377 #define EALREADY 114 /* Operation already in progress */
378 #undef EINPROGRESS
379 #define EINPROGRESS 115 /* Operation now in progress */
380 #undef ESTALE
381 #define ESTALE 116 /* Stale NFS file handle */
382 #undef EUCLEAN
383 #define EUCLEAN 117 /* Structure needs cleaning */
384 #undef ENOTNAM
385 #define ENOTNAM 118 /* Not a XENIX named type file */
386 #undef ENAVAIL
387 #define ENAVAIL 119 /* No XENIX semaphores available */
388 #undef EISNAM
389 #define EISNAM 120 /* Is a named type file */
390 #undef EREMOTEIO
391 #define EREMOTEIO 121 /* Remote I/O error */
392 #undef EDQUOT
393 #define EDQUOT 122 /* Quota exceeded */
394 #undef ENOMEDIUM
395 #define ENOMEDIUM 123 /* No medium found */
396 #undef EMEDIUMTYPE
397 #define EMEDIUMTYPE 124 /* Wrong medium type */
398 #undef ECANCELED
399 #define ECANCELED 125 /* Operation Canceled */
400 #undef ENOKEY
401 #define ENOKEY 126 /* Required key not available */
402 #undef EKEYEXPIRED
403 #define EKEYEXPIRED 127 /* Key has expired */
404 #undef EKEYREVOKED
405 #define EKEYREVOKED 128 /* Key has been revoked */
406 #undef EKEYREJECTED
407 #define EKEYREJECTED 129 /* Key was rejected by service */
408 #undef EOWNERDEAD
409 #define EOWNERDEAD 130 /* Owner died */
410 #undef ENOTRECOVERABLE
411 #define ENOTRECOVERABLE 131 /* State not recoverable */
412 
413 /* Missing stat.h defines.
414  * The following are sys/stat.h definitions not currently present in the ARMCC
415  * errno.h. Note, ARMCC errno.h defines some symbol values differing from
416  * GCC_ARM/IAR/standard POSIX definitions. Guard against this and future
417  * changes by changing the symbol definition for filesystem use.
418  */
419 #define _IFMT 0170000 //< type of file
420 #define _IFSOCK 0140000 //< socket
421 #define _IFLNK 0120000 //< symbolic link
422 #define _IFREG 0100000 //< regular
423 #define _IFBLK 0060000 //< block special
424 #define _IFDIR 0040000 //< directory
425 #define _IFCHR 0020000 //< character special
426 #define _IFIFO 0010000 //< fifo special
427 
428 #define S_IFMT _IFMT //< type of file
429 #define S_IFSOCK _IFSOCK //< socket
430 #define S_IFLNK _IFLNK //< symbolic link
431 #define S_IFREG _IFREG //< regular
432 #define S_IFBLK _IFBLK //< block special
433 #define S_IFDIR _IFDIR //< directory
434 #define S_IFCHR _IFCHR //< character special
435 #define S_IFIFO _IFIFO //< fifo special
436 
437 #define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
438 #define S_IRUSR 0000400 ///< read permission, owner
439 #define S_IWUSR 0000200 ///< write permission, owner
440 #define S_IXUSR 0000100 ///< execute/search permission, owner
441 #define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
442 #define S_IRGRP 0000040 ///< read permission, group
443 #define S_IWGRP 0000020 ///< write permission, group
444 #define S_IXGRP 0000010 ///< execute/search permission, group
445 #define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
446 #define S_IROTH 0000004 ///< read permission, other
447 #define S_IWOTH 0000002 ///< write permission, other
448 #define S_IXOTH 0000001 ///< execute/search permission, other
449 
450 /* Refer to sys/stat standard
451  * Note: Not all fields may be supported by the underlying filesystem
452  */
453 struct stat {
454  dev_t st_dev; ///< Device ID containing file
455  ino_t st_ino; ///< File serial number
456  mode_t st_mode; ///< Mode of file
457  nlink_t st_nlink; ///< Number of links to file
458 
459  uid_t st_uid; ///< User ID
460  gid_t st_gid; ///< Group ID
461 
462  off_t st_size; ///< Size of file in bytes
463 
464  time_t st_atime; ///< Time of last access
465  time_t st_mtime; ///< Time of last data modification
466  time_t st_ctime; ///< Time of last status change
467 };
468 
469 struct statvfs {
470  unsigned long f_bsize; ///< Filesystem block size
471  unsigned long f_frsize; ///< Fragment size (block size)
472 
473  fsblkcnt_t f_blocks; ///< Number of blocks
474  fsblkcnt_t f_bfree; ///< Number of free blocks
475  fsblkcnt_t f_bavail; ///< Number of free blocks for unprivileged users
476 
477  unsigned long f_fsid; ///< Filesystem ID
478 
479  unsigned long f_namemax; ///< Maximum filename length
480 };
481 
482 /* The following are dirent.h definitions are declared here to guarantee
483  * consistency where structure may be different with different toolchains
484  */
485 struct dirent {
486  char d_name[NAME_MAX + 1]; ///< Name of file
487  uint8_t d_type; ///< Type of file
488 };
489 
490 enum {
491  DT_UNKNOWN, ///< The file type could not be determined.
492  DT_FIFO, ///< This is a named pipe (FIFO).
493  DT_CHR, ///< This is a character device.
494  DT_DIR, ///< This is a directory.
495  DT_BLK, ///< This is a block device.
496  DT_REG, ///< This is a regular file.
497  DT_LNK, ///< This is a symbolic link.
498  DT_SOCK, ///< This is a UNIX domain socket.
499 };
500 
501 /* fcntl.h defines */
502 #define F_GETFL 3
503 #define F_SETFL 4
504 
505 struct pollfd {
506  int fd;
507  short events;
508  short revents;
509 };
510 
511 /* POSIX-compatible I/O functions */
512 #if __cplusplus
513 extern "C" {
514 #endif
515  int open(const char *path, int oflag, ...);
516 #ifndef __IAR_SYSTEMS_ICC__ /* IAR provides fdopen itself */
517 #if __cplusplus
518  std::FILE *fdopen(int fildes, const char *mode);
519 #else
520  FILE *fdopen(int fildes, const char *mode);
521 #endif
522 #endif
523  ssize_t write(int fildes, const void *buf, size_t nbyte);
524  ssize_t read(int fildes, void *buf, size_t nbyte);
525  off_t lseek(int fildes, off_t offset, int whence);
526  int isatty(int fildes);
527  int fsync(int fildes);
528  int fstat(int fildes, struct stat *st);
529  int fcntl(int fildes, int cmd, ...);
530  int poll(struct pollfd fds[], nfds_t nfds, int timeout);
531  int close(int fildes);
532  int stat(const char *path, struct stat *st);
533  int statvfs(const char *path, struct statvfs *buf);
534  DIR *opendir(const char *);
535  struct dirent *readdir(DIR *);
536  int closedir(DIR *);
537  void rewinddir(DIR *);
538  long telldir(DIR *);
539  void seekdir(DIR *, long);
540  int mkdir(const char *name, mode_t n);
541 #if __cplusplus
542 }; // extern "C"
543 
544 namespace mbed {
545 
546 /** This call is an analogue to POSIX fdopen().
547  *
548  * It associates a C stream to an already-opened FileHandle, to allow you to
549  * use C printf/scanf/fwrite etc. The provided FileHandle must remain open -
550  * it will be closed by the C library when fclose(FILE) is called.
551  *
552  * The net effect is fdopen(bind_to_fd(fh), mode), with error handling.
553  *
554  * @param fh a pointer to an opened FileHandle
555  * @param mode operation upon the file descriptor, e.g., "w+"
556  *
557  * @returns a pointer to FILE
558  */
559 std::FILE *fdopen(mbed::FileHandle *fh, const char *mode);
560 
561 /** Bind an mbed FileHandle to a POSIX file descriptor
562  *
563  * This is similar to fdopen, but only operating at the POSIX layer - it
564  * associates a POSIX integer file descriptor with a FileHandle, to allow you
565  * to use POSIX read/write calls etc. The provided FileHandle must remain open -
566  * it will be closed when close(int) is called.
567  *
568  * @param fh a pointer to an opened FileHandle
569  *
570  * @return an integer file descriptor, or negative if no descriptors available
571  */
572 int bind_to_fd(mbed::FileHandle *fh);
573 
574 } // namespace mbed
575 
576 #endif // __cplusplus
577 
578 /**@}*/
579 
580 /**@}*/
581 
582 #endif /* RETARGET_H */
unsigned long f_fsid
Filesystem ID.
Definition: mbed_retarget.h:477
fsblkcnt_t f_bavail
Number of free blocks for unprivileged users.
Definition: mbed_retarget.h:475
This is a character device.
Definition: mbed_retarget.h:493
The file type could not be determined.
Definition: mbed_retarget.h:491
This is a symbolic link.
Definition: mbed_retarget.h:497
time_t st_ctime
Time of last status change.
Definition: mbed_retarget.h:466
Definition: DirHandle.h:49
fsblkcnt_t f_blocks
Number of blocks.
Definition: mbed_retarget.h:473
This is a regular file.
Definition: mbed_retarget.h:496
This is a block device.
Definition: mbed_retarget.h:495
This is a named pipe (FIFO).
Definition: mbed_retarget.h:492
dev_t st_dev
Device ID containing file.
Definition: mbed_retarget.h:454
Definition: FileHandle.h:45
Definition: mbed_retarget.h:485
nlink_t st_nlink
Number of links to file.
Definition: mbed_retarget.h:457
Definition: Dir.h:30
unsigned long f_frsize
Fragment size (block size)
Definition: mbed_retarget.h:471
unsigned long f_namemax
Maximum filename length.
Definition: mbed_retarget.h:479
mode_t st_mode
Mode of file.
Definition: mbed_retarget.h:456
Definition: mbed_retarget.h:505
Definition: mbed_retarget.h:453
This is a directory.
Definition: mbed_retarget.h:494
ino_t st_ino
File serial number.
Definition: mbed_retarget.h:455
Definition: EventQueue.h:26
fsblkcnt_t f_bfree
Number of free blocks.
Definition: mbed_retarget.h:474
time_t st_atime
Time of last access.
Definition: mbed_retarget.h:464
uint8_t d_type
Type of file.
Definition: mbed_retarget.h:487
Definition: mbed_retarget.h:469
off_t st_size
Size of file in bytes.
Definition: mbed_retarget.h:462
This is a UNIX domain socket.
Definition: mbed_retarget.h:498
Definition: AnalogIn.cpp:21
time_t st_mtime
Time of last data modification.
Definition: mbed_retarget.h:465
uid_t st_uid
User ID.
Definition: mbed_retarget.h:459
gid_t st_gid
Group ID.
Definition: mbed_retarget.h:460
unsigned long f_bsize
Filesystem block size.
Definition: mbed_retarget.h:470
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.