Ignore:
Timestamp:
Sep 12, 2004, 9:40:29 PM (21 years ago)
Author:
bird
Message:

Adding BSD stuff like there was no tomorrow.

Location:
trunk/src/emx/include/InnoTekLIBC
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/include/InnoTekLIBC/backend.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1504 r1505  
    2828#define __InnoTekLIBC_backend_h__
    2929
     30#include <sys/cdefs.h>
     31#include <sys/types.h>
     32
     33__BEGIN_DECLS
     34
    3035#ifndef __LIBC_THREAD_DECLARED
    3136#define __LIBC_THREAD_DECLARED
    3237typedef struct __libc_thread *__LIBC_PTHREAD, **__LIBC_PPTHREAD;
    3338#endif
     39struct statfs;
    3440
    3541
    36 /** @group __libc_Back_thread   LIBC Backend - Threads
     42/** @defgroup __libc_Back_thread   LIBC Backend - Threads
    3743 * @{ */
    3844
     
    7581/** @} */
    7682
    77 #if defined (__cplusplus)
    78 }
     83
     84/** @defgroup __libc_Back_fh   LIBC Backend - File Handles.
     85 * @{ */
     86
     87/**
     88 * Try resolve a filehandle to a path.
     89 *
     90 * @returns 0 on success.
     91 * @returns -1 and errno on failure.
     92 * @param   fh          The file handle.
     93 * @param   pszPath     Where to store the path.
     94 * @param   cchPath     The size of he buffer pointed to by pszPath.
     95 */
     96int __libc_Back_fhToPath(int fh, char *pszPath, size_t cchPath);
     97
     98/** @} */
     99
     100
     101/** @defgroup __libc_Back_fs   LIBC Backend - File System
     102 * @{ */
     103
     104/**
     105 * Get the statistics for the filesystem which pszPath is located on.
     106 *
     107 * @returns 0 on success.
     108 * @returns -1 and errno on failure.
     109 * @param   pszPath     The path to somewhere in the filesystem.
     110 * @param   pStatFs     Where to store the obtained information.
     111 */
     112int __libc_Back_fsStat(const char *pszPath, struct statfs *pStatFs);
     113
     114/**
     115 * Get file system statistics
     116 *
     117 * @returns 0 on success.
     118 * @returns -1 and errno on failure.
     119 * @param   fh          The filehandle of any file within the mounted file system.
     120 * @param   pStatFs     Where to store the statistics.
     121 */
     122int __libc_Back_fsStatFH(int fh, struct statfs *pStatFs);
     123
     124/**
     125 * Get the statistics for all the mounted filesystems.
     126 *
     127 * @returns Number of returned statfs structs on success.
     128 * @returns Number of mounted filesystems on success if paStatFS is NULL
     129 * @returns -1 and errno on failure.
     130 * @param   paStatFs    Where to to store the statistics.
     131 * @parma   cStatFS     Number of structures the array pointed to by paStatFs can hold.
     132 * @param   fFlags      Flags, currently ignored.
     133 */
     134int __libc_Back_fsStats(struct statfs *paStatFs, unsigned cStatFs, unsigned fFlags);
     135
     136/**
     137 * Schedules all file system buffers for writing.
     138 *
     139 * See sync() for OS/2 limitations.
     140 */
     141void __libc_Back_fsSync(void);
     142
     143/** @} */
     144
     145
     146
     147/** @defgroup __libc_Back_misc   LIBC Backend - Miscellaneous
     148 * @{ */
     149
     150/**
     151 * Gets the system load averages.
     152 * The load is the average values of ready and running threads(/processes)
     153 * over the last 1, 5 and 15 minuttes.
     154 *
     155 * @returns 0 on success.
     156 * @returns -1 and errno on failure.
     157 * @param   pardAvgs    Where to store the samples.
     158 * @param   cAvgs       Number of samples to get. Max is 3.
     159 * @remark  See OS/2 limitations in getloadavg().
     160 */
     161int __libc_Back_miscLoadAvg(double *pardAvgs, unsigned cAvgs);
     162
     163/** @} */
     164
     165__END_DECLS
     166
    79167#endif
    80 
    81 #endif /* not _EMX_SYSCALLS_H */
  • trunk/src/emx/include/InnoTekLIBC/sharedpm.h

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r1504 r1505  
    298298
    299299/**
     300 * The structure contains the system load averages.
     301 */
     302typedef struct __libc_SPMLoadAvg
     303{
     304    /** Array of the three stamples.
     305     * The entries are for 1, 5 and 15 min averages respectively.
     306     *
     307     * The samples them selfs are stored as integers and not as a
     308     * double as the interface returns. The reason is that this is smaller
     309     * and it's what both BSD and Linux is doing. The fraction part is
     310     * the lower 11 bits (this is also identical to BSD and Linux).
     311     */
     312    uint32_t                    u32Samples[3];
     313    /** Timestamp of the last update. */
     314    unsigned                    uTimestamp;
     315} __LIBC_SPMLOADAVG;
     316/** Pointer to load averages. */
     317typedef __LIBC_SPMLOADAVG *__LIBC_PSPMLOADAVG;
     318
     319
     320/**
    300321 * This is the header of the LIBC shared memory.
    301322 */
     
    336357        char                    ach[16];
    337358    };
     359
     360    /** System Load Averages. */
     361    __LIBC_SPMLOADAVG           LoadAvg;
     362
    338363    /* The rest of the block, up to cbProcess, is undefined in this version.
    339364     * Future versions of LIBC may use this area assuming it's initalized with zeros.
     
    531556
    532557/**
     558 * Get the stored load average samples.
     559 *
     560 * @returns 0 on success.
     561 * @returns -1 and errno on failure.
     562 * @param   pLoadAvg    Where to store the load average samples.
     563 * @param   puTimestamp Where to store the current timestamp.
     564 */
     565int     __libc_spmGetLoadAvg(__LIBC_PSPMLOADAVG  pLoadAvg, unsigned *puTimestamp);
     566
     567/**
     568 * Get the stored load average samples.
     569 *
     570 * @returns 0 on success.
     571 * @returns -1 and errno on failure.
     572 * @param   pLoadAvg    Where to store the load average samples.
     573 */
     574int     __libc_spmSetLoadAvg(const __LIBC_SPMLOADAVG *pLoadAvg);
     575
     576/**
    533577 * Checks the SPM memory for trouble.
    534578 *
Note: See TracChangeset for help on using the changeset viewer.