Fossil SCM

If the "fds" query parameter is provided, then the /test-backoffice-lease webpage shows the open file descriptors.

drh 2018-08-08 16:20 trunk
Commit 918e1ddd8e566541a7786d7280208390ff6bab04aef3b84edb80ff9164b632bf
1 file changed +14
--- src/backoffice.c
+++ src/backoffice.c
@@ -77,10 +77,11 @@
7777
#else
7878
# include <unistd.h>
7979
# include <sys/types.h>
8080
# include <signal.h>
8181
# include <errno.h>
82
+# include <fcntl.h>
8283
# define GETPID getpid
8384
#endif
8485
8586
/*
8687
** The BKOFCE_LEASE_TIME is the amount of time for which a single backoffice
@@ -489,10 +490,23 @@
489490
@ <tr><th>tmNext:</th><td>%lld(x.tmNext)</td><td></td><td>\
490491
if( x.tmNext>0 ){
491492
@ (now%+lld(x.tmNext-tmNow)) \
492493
}
493494
@ </td></tr>
495
+#ifndef _WIN32
496
+ if( P("fds")!=0 ){
497
+ int i;
498
+ @ <tr><th>open fds:</th><td colspan="3">
499
+ for(i=0; i<1000; i++){
500
+ int rc = fcntl(i, F_GETFL, 0);
501
+ if( rc<0 ) continue;
502
+ @ %d(i) \
503
+ }
504
+ @ </td></tr>
505
+ }
506
+#endif
507
+
494508
@ </table>
495509
style_footer();
496510
}
497511
498512
/*
499513
--- src/backoffice.c
+++ src/backoffice.c
@@ -77,10 +77,11 @@
77 #else
78 # include <unistd.h>
79 # include <sys/types.h>
80 # include <signal.h>
81 # include <errno.h>
 
82 # define GETPID getpid
83 #endif
84
85 /*
86 ** The BKOFCE_LEASE_TIME is the amount of time for which a single backoffice
@@ -489,10 +490,23 @@
489 @ <tr><th>tmNext:</th><td>%lld(x.tmNext)</td><td></td><td>\
490 if( x.tmNext>0 ){
491 @ (now%+lld(x.tmNext-tmNow)) \
492 }
493 @ </td></tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
494 @ </table>
495 style_footer();
496 }
497
498 /*
499
--- src/backoffice.c
+++ src/backoffice.c
@@ -77,10 +77,11 @@
77 #else
78 # include <unistd.h>
79 # include <sys/types.h>
80 # include <signal.h>
81 # include <errno.h>
82 # include <fcntl.h>
83 # define GETPID getpid
84 #endif
85
86 /*
87 ** The BKOFCE_LEASE_TIME is the amount of time for which a single backoffice
@@ -489,10 +490,23 @@
490 @ <tr><th>tmNext:</th><td>%lld(x.tmNext)</td><td></td><td>\
491 if( x.tmNext>0 ){
492 @ (now%+lld(x.tmNext-tmNow)) \
493 }
494 @ </td></tr>
495 #ifndef _WIN32
496 if( P("fds")!=0 ){
497 int i;
498 @ <tr><th>open fds:</th><td colspan="3">
499 for(i=0; i<1000; i++){
500 int rc = fcntl(i, F_GETFL, 0);
501 if( rc<0 ) continue;
502 @ %d(i) \
503 }
504 @ </td></tr>
505 }
506 #endif
507
508 @ </table>
509 style_footer();
510 }
511
512 /*
513

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button