Displaying 20 results from an estimated 50 matches for "clock_t".
2010 Mar 18
0
[MODULE] COM32 module to time null-dumping a file
...inc: xfer_buf_seg equ 1000h
+ */
+
+float get_tps(){ return 18.2; }
+
+#else /* __COM32__ */
+
+#define BUFSZ 16384
+/* Need to check what might be a "best" buffer/fetch block size here */
+
+float get_tps(){ return (float)sysconf(_SC_CLK_TCK); }
+void print_cp_result2(char *fn, int bcnt, clock_t bc, clock_t ec)
+{
+ float et, dr;
+ et = ((float)(ec - bc)) / (float)sysconf(_SC_CLK_TCK);
+ dr = ((float)bcnt) / et;
+ printf(" %dB in %.3fs from '%s'\n", bcnt, et, fn);
+ printf(" %.0f B/s; %.0f KiB/s; %.0f MiB/s\n", dr, dr/1024, dr/1048576);
+} /* void print_cp_res...
2012 May 04
3
[GIT PULL] elflink fixes
...nclude "cli.h"
#include "config.h"
-static jmp_buf timeout_jump;
-
static struct list_head cli_history_head;
void clear_screen(void)
@@ -29,46 +27,37 @@ void clear_screen(void)
fputs("\033e\033%@\033)0\033(B\1#0\033[?25l\033[2J", stdout);
}
-int mygetkey(clock_t timeout)
+static int mygetkey_timeout(clock_t *kbd_to, clock_t *tto)
{
- clock_t t0, t;
- clock_t tto, to;
+ clock_t t0, t1;
int key;
- //dprintf("enter");
- if (!totaltimeout)
- return get_key(stdin, 0);
-
- for (;;) {
- tto = min(totaltimeout, INT_MAX);
- to =...
2010 Mar 20
1
[MODULE] COM32 module to time null-dumping a file, v1.1
...ine SSIZE_MAX PTRDIFF_MAX
+#endif
+/* typedef ptrdiff_t ssize_t; */
+#define BUFSZ_MAX SSIZE_MAX
+/* ssize_t max */
+#define BUFSZ_MIN 1
+#ifndef OFF_MAX
+# define OFF_MAX SIZE_MAX
+#endif
+/* typedef size_t off_t */
+#define LEN_MAX OFF_MAX
+/* off_t max */
+
+void print_cp_result_tick(int bcnt, clock_t et, float tps, int offs)
+{
+ int dr;
+ dr = bcnt * tps / max(1,(et + offs)); // prevent divide by 0
+ printf(" %+d %d B/s; %d KiB/s; %d MiB/s\n", offs, dr, dr/1024, dr/1048576);
+} /* void print_cp_result_tick(int bcnt, clock_t et, float tps, int offs) */
+
+void print_cp_result(char *f...
2001 Jan 11
2
Is anyone else getting this build error?
This is from the current CVS:
% make
...
In file included from config.h:629,
from /home/mo/project/openssh_cvs/includes.h:20,
from /home/mo/project/openssh_cvs/scp.c:77:
/home/mo/project/openssh_cvs/defines.h:208: warning: redefinition of
`clock_t'
/usr/include/time.h:60: warning: `clock_t' previously declared here
gcc -o scp scp.o -L. -L/usr/local/ssl/lib -L/usr/local/ssl -lssh
-lopenbsd-compat -ldl -lnsl -lz -lutil -lpam -lcrypto
./libssh.a(log.o): In function `fatal':
/home/mo/project/openssh_cvs/log.c:51: undefined refer...
2009 Apr 01
2
[LLVMdev] adding header files to code
...m adding call to clock() in the C code of the given program.
However this will require adding the file time.h to C code. Can some tell
me a way to do so.
I have tried using Module.addLibrary("time.h"); but this doesn't seem to
address the problem because I am not able to get the type clock_t by using
Module.getType() .Moreover only adding just the module.addlibrary does not
add the header file in the generated c code.
It would be a great help if someone could shed light as to how to introduce
header files by a transformation pass and able to use the types defined in
the header file in...
2011 Feb 17
5
[PATCH 0/4] Reduce core size
From: Matt Fleming <matt.fleming at linux.intel.com>
These patches are based on the elflink branch.
This set of patches is my attempt at moving the command-line interface
functionality out of the core and into an ELF module to reduce the
size of the core.
The most interesting patch is [PATCH 4/4] which moves the cli code out
of core/elflink and into com32/elflink/modules. [PATCH 4/4] is
2007 Aug 16
0
[PATCH/RFC 2/4]Introduce a new field "guest" in task_struct
...=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- kvm.orig/fs/proc/array.c 2007-08-16 15:23:52.000000000 +0200
+++ kvm/fs/proc/array.c 2007-08-16 15:36:54.000000000 +0200
@@ -354,6 +354,13 @@
return stime;
}
=
+static clock_t task_gtime(struct task_struct *p)
+{
+ clock_t gtime =3D cputime_to_clock_t(p->gtime);
+
+ return gtime;
+}
+
static int do_task_stat(struct task_struct *task, char *buffer, int whole)
{
unsigned long vsize, eip, esp, wchan =3D ~0UL;
@@ -368,8 +375,8 @@
unsigned long long start_time;
uns...
2007 Aug 16
0
[PATCH/RFC 2/4]Introduce a new field "guest" in task_struct
...=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- kvm.orig/fs/proc/array.c 2007-08-16 15:23:52.000000000 +0200
+++ kvm/fs/proc/array.c 2007-08-16 15:36:54.000000000 +0200
@@ -354,6 +354,13 @@
return stime;
}
=
+static clock_t task_gtime(struct task_struct *p)
+{
+ clock_t gtime =3D cputime_to_clock_t(p->gtime);
+
+ return gtime;
+}
+
static int do_task_stat(struct task_struct *task, char *buffer, int whole)
{
unsigned long vsize, eip, esp, wchan =3D ~0UL;
@@ -368,8 +375,8 @@
unsigned long long start_time;
uns...
2007 Aug 20
3
[PATCH 2/4] Introduce a new fields "gtime" and "cgtime" in task_struct and signal_struct
...D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- kvm.orig/fs/proc/array.c 2007-08-20 11:11:30.000000000 +0200
+++ kvm/fs/proc/array.c 2007-08-20 13:04:03.000000000 +0200
@@ -354,6 +354,15 @@ static clock_t task_stime(struct task_st
return stime;
}
=
+#ifdef CONFIG_GUEST_ACCOUNTING
+static clock_t task_gtime(struct task_struct *p)
+{
+ clock_t gtime =3D cputime_to_clock_t(p->gtime);
+
+ return gtime;
+}
+#endif
+
static int do_task_stat(struct task_struct *task, char *buffer, int whole)
{...
2007 Aug 20
3
[PATCH 2/4] Introduce a new fields "gtime" and "cgtime" in task_struct and signal_struct
...D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- kvm.orig/fs/proc/array.c 2007-08-20 11:11:30.000000000 +0200
+++ kvm/fs/proc/array.c 2007-08-20 13:04:03.000000000 +0200
@@ -354,6 +354,15 @@ static clock_t task_stime(struct task_st
return stime;
}
=
+#ifdef CONFIG_GUEST_ACCOUNTING
+static clock_t task_gtime(struct task_struct *p)
+{
+ clock_t gtime =3D cputime_to_clock_t(p->gtime);
+
+ return gtime;
+}
+#endif
+
static int do_task_stat(struct task_struct *task, char *buffer, int whole)
{...
2005 Mar 02
0
[PATCH] sys/times.h
This patch addresses three issues:
- need extern.h because of __extern.
- need sys/types for clock_t
- two functions are also included in <sys/time.h>;
my (debian) manual pages confirm that's the canonical location.
Regards,
Erik
diff -urN klibc-0.202-pristine/include/sys/times.h klibc-0.202/include/sys/times.h
--- klibc-0.202-pristine/include/sys/times.h 2002-08-06 01:03:09.000000...
2007 Aug 21
5
proper way to sleep
This is not spam about sleep aids :)
Q: Is there a 'standard' way to sleep for a specified number of BIOS ticks
(or seconds) in a com32 program?
I grepped through the com32 library source and didn't find anything for
'sleep' or 'tick'.
If not, you may want to consider adding:
void syslinux_sleep(int seconds);
void syslinux_sleep_bios_ticks(int ticks);
or
2006 May 25
1
pxelinux/mboot confused about e820 memory maps on HP Proliant BIOS's
...0 -0700
+++ fixed-syslinux/./syslinux-3.11/com32/libutil/get_key.c 2006-05-25 14:03:01.000000000 -0700
@@ -116,7 +116,7 @@
};
#define NCODES ((int)(sizeof keycodes/sizeof(struct keycode)))
-#define KEY_TIMEOUT ((CLK_TCK+9)/10)
+#define KEY_TIMEOUT ((CLOCKS_PER_SEC+9)/10)
int get_key(FILE *f, clock_t timeout)
{
--- baseline-syslinux/./syslinux-3.11/com32/include/sys/times.h 2006-05-25 14:03:31.000000000 -0700
+++ fixed-syslinux/./syslinux-3.11/com32/include/sys/times.h 2006-05-25 14:03:02.000000000 -0700
@@ -13,6 +13,7 @@
#define HZ 18 /* Piddly resolution... */
#define CLK_TCK HZ
+...
2010 Jul 04
5
dovecot-1.2.12 fails to build on Solaris 8 and 10
configure fails with :
configure: error: Unsupported off_t type
I am not too sure what off_t is needed but this is a pretty standard thing.
My configure line :
./configure --build=i386-pc-solaris2.10 --host=i386-pc-solaris2.10
--prefix=/opt/csw --with-zlib --with-ssl=openssl
--with-storages=mbox,maildir --with-libiconv-prefix=/opt/csw
Yes, the openssl libs are in /opt/csw/lib
Not sure what
2011 Mar 09
14
[PATCH 00/12] elflink shrinkage
From: Matt Fleming <matt.fleming at linux.intel.com>
This is a series of patches that,
* shrink the core by moving things into an ldlinux ELF module
* begin wiring up some of the C versions of various functions
The core now only contains essential code and loads the ldlinux module
to do everything else, like providing a command line interface and
loading kernels.
The config file parsing
2011 Apr 02
2
[patch] ~420 seconds in cpu_detect
...o worth noting that when offending code is restored,
I get this value out
Vendor : ??????????????????????????????????
with replacement code:
strlcpy(cpu->model, c->x86_vendor_id, sizeof(cpu->vendor));
I get ""
void set_generic_info(struct cpuinfo_x86 *c, s_cpu * cpu)
{
clock_t et = times(NULL);
printf("sizeof(cpu->vendor): %d\n", sizeof(cpu->vendor));
printf("sizeof(cpu->model): %d\n", sizeof(cpu->model));
cpu->family = c->x86;
cpu->vendor_id = c->x86_vendor;
cpu->model_id = c->x86_model;
cpu->...
2011 Apr 02
2
[patch] ~420 seconds in cpu_detect
...o worth noting that when offending code is restored,
I get this value out
Vendor : ??????????????????????????????????
with replacement code:
strlcpy(cpu->model, c->x86_vendor_id, sizeof(cpu->vendor));
I get ""
void set_generic_info(struct cpuinfo_x86 *c, s_cpu * cpu)
{
clock_t et = times(NULL);
printf("sizeof(cpu->vendor): %d\n", sizeof(cpu->vendor));
printf("sizeof(cpu->model): %d\n", sizeof(cpu->model));
cpu->family = c->x86;
cpu->vendor_id = c->x86_vendor;
cpu->model_id = c->x86_model;
cpu->...
2012 Nov 02
10
[PATCH 0/9] elflink fixes
From: Matt Fleming <matt.fleming at intel.com>
Here are the patches that I've got queued up based on the very helpful
feedback I received from people testing Syslinux 5.00-pre9. Unless
anyone has any concerns these will make it into Syslinux 5.00-pre10.
Matt Fleming (9):
pxe: Don't call open_config() from the pxe core
ldlinux: Print a warning if no config file is found
2008 Jul 21
3
Wine memory limitation for malloc?
...te only 2000 MB of memory, but same programm translated by gcc can get 3800 MB.
(OS/Compilers - WinXP/Visual C 6.0 32 bit, and openSUSE 11 x64/gcc -m32)
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
main(int argc, char **argv)
{unsigned long n,m,i; int *p,*p1,*p2,*p3; clock_t time1,time2;
i=4095; if (argc == 2) i = (size_t) strtoul(argv[1], NULL, 0);
m=i*1024*1024; while( (p=(int*)malloc(m)) ==0 ) m-=1024l*1024l;
printf("Allocated %u MB ( %u bytes )\n",m/1024l/1024l,m);
getchar(); free(p); exit(0);
}
2013 Sep 16
0
[PATCH 1/2] com32: Fix bugs on cmd_reverse_search (Triple fault dimension)
...+++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/com32/elflink/ldlinux/cli.c b/com32/elflink/ldlinux/cli.c
index 7c4f14c..b70224a 100644
--- a/com32/elflink/ldlinux/cli.c
+++ b/com32/elflink/ldlinux/cli.c
@@ -89,10 +89,14 @@ static const char * cmd_reverse_search(int *cursor, clock_t *kbd_to,
break;
}
- while (!list_is_last(&last_found->list, &cli_history_head)) {
+ while (last_found) {
p = strstr(last_found->command, buf);
if (p)
break;
+
+ if (list_is_last(&last_found->list, &cli_history_head))
+ break;
+...