int para_exec_cmdline_pid(pid_t *pid, const char *cmdline, int *fds);
/* time */
-int tv_diff(const struct timeval *b, const struct timeval *a, struct timeval *diff);
-long unsigned tv2ms(const struct timeval*);
-void d2tv(double, struct timeval*);
-void tv_add(const struct timeval*, const struct timeval *, struct timeval *);
-void tv_scale(const unsigned long, const struct timeval *, struct timeval *);
+int tv_diff(const struct timeval *b, const struct timeval *a,
+ struct timeval *diff);
+long unsigned tv2ms(const struct timeval *tv);
+void d2tv(double x, struct timeval *tv);
+void tv_add(const struct timeval *a, const struct timeval *b,
+ struct timeval *sum);
+void tv_scale(const unsigned long mult, const struct timeval *tv,
+ struct timeval *result);
void tv_divide(const unsigned long divisor, const struct timeval *tv,
- struct timeval *result);
+ struct timeval *result);
int tv_convex_combination(const long a, const struct timeval *tv1,
const long b, const struct timeval *tv2,
struct timeval *result);
-void ms2tv(const long unsigned n, struct timeval *tv);
+void ms2tv(long unsigned n, struct timeval *tv);
void compute_chunk_time(long unsigned chunk_num,
struct timeval *chunk_tv, struct timeval *stream_start,
struct timeval *result);
*
* \return If \a b < \a a, this function returns -1, otherwise it returns 1.
*/
-int tv_diff(const struct timeval *b, const struct timeval *a, struct timeval *diff)
+int tv_diff(const struct timeval *b, const struct timeval *a,
+ struct timeval *diff)
{
int ret = 1;
* \param sum Contains the sum \a a + \a b on return.
*/
void tv_add(const struct timeval *a, const struct timeval *b,
- struct timeval *sum)
+ struct timeval *sum)
{
sum->tv_sec = a->tv_sec + b->tv_sec;
if (a->tv_usec + b->tv_usec >= 1000 * 1000) {
* \param result Contains \a mult * \a tv on return.
*/
void tv_scale(const unsigned long mult, const struct timeval *tv,
- struct timeval *result)
+ struct timeval *result)
{
uint64_t x = ((uint64_t)tv->tv_sec * 1000 * 1000 + tv->tv_usec) * mult;
* \param result Contains (1 / mult) * tv on return.
*/
void tv_divide(const unsigned long divisor, const struct timeval *tv,
- struct timeval *result)
+ struct timeval *result)
{
uint64_t x = ((uint64_t)tv->tv_sec * 1000 * 1000 + tv->tv_usec) / divisor;