Go to advanced search

by Pancho88
Mon Apr 01, 2019 11:06 pm
Forum: C/C++
Topic: ATEXIT behavior
Replies: 17
Views: 2127

Re: ATEXIT behavior

Hello LDB Will you please post a section of the executable code where the DLL is unloaded and a section of the DLL code where the 'atexit' function is installed. I have built many, many executables, dynamic libraries with the Tiny C compiler with no problem. I have in my computer the Watcom C compil...
by Pancho88
Sun Mar 31, 2019 7:47 pm
Forum: C/C++
Topic: ATEXIT behavior
Replies: 17
Views: 2127

Re: ATEXIT behavior

Hello everyone. Heater That is so cute. Hey, thanks for your eye opener! Ok, I think I got to understand this problem. Why it works in linux but not in Windows. It is Not atexit bevavior. It is the difference between FreeLibrary, and dlclose. FreeLibrary Is part of Windows OS "KERNEL32.DLL", dlclose...
by Pancho88
Sat Mar 30, 2019 11:06 pm
Forum: C/C++
Topic: ATEXIT behavior
Replies: 17
Views: 2127

Re: ATEXIT behavior

Hello

I would expect "atexit" to behave the same in linux, and windows.

Atexit is in C lang, which is supposed to be very portable.

Since that is not the case, to me that is not OK.

Bye
by Pancho88
Sat Mar 30, 2019 6:53 pm
Forum: C/C++
Topic: ATEXIT behavior
Replies: 17
Views: 2127

Re: ATEXIT behavior

Hello JOJOPI Putting a sleep() between dlclose() and exit(), this is indeed what is happening. Paeryn Still, it is implementation defined so just because it works on modern Linux with glibc doesn't mean it won't break on another system. That is why it may work in linux, but not in Windows. So we hav...
by Pancho88
Sat Mar 30, 2019 12:33 am
Forum: C/C++
Topic: ATEXIT behavior
Replies: 17
Views: 2127

Re: ATEXIT behavior

Hello The executable is compiled "gcc xyz.c -o xyz -ldl" in linux, "tcc xyz.c" with tiny c in windows. The SO/DLL is compiled "gcc -shared zyx.c -o libzyx.so", "tcc -shared zyx.c" in windows. Executable loads zyx //linux hndl=dlopen("libzyx.so", RTLD_NOW); proc=dlsym(hndl, "run"); //windows hndl=Loa...
by Pancho88
Fri Mar 29, 2019 9:47 pm
Forum: C/C++
Topic: ATEXIT behavior
Replies: 17
Views: 2127

Re: ATEXIT behavior

I thought the problem was stated clearly. But anyway //SO/DLL void t1(){ printf("exiting!!!\n"); } static int iflag; //DLL_EXPORT char * _run(char *proc, int *e, int argn, char **argz) { char * run(char *proc, int *e, int argn, char **argz) { if (iflag==0) {iflag=1; atexit(t1);} //Executable int mai...
by Pancho88
Fri Mar 29, 2019 6:36 pm
Forum: C/C++
Topic: ATEXIT behavior
Replies: 17
Views: 2127

ATEXIT behavior

Hello everyone I am testing a small, simple so/dll library. It has an 'atexit' function calling another function that prints 'exiting'. The executable that loads the library, just before ending unloads the os/dll. In Rpi/stretch it prints 'exiting', looks like linux defers, delays removing it from m...
by Pancho88
Fri Feb 15, 2019 10:04 pm
Forum: Other programming languages
Topic: WSD is in Google Drive
Replies: 0
Views: 583

WSD is in Google Drive

hello everyone WSD is in Google Drive to make browsing, and downloading easy. Here is the link https://drive.google.com/drive/folders/1GcjofvXgsfd00tq2bgnqtQlJL6o_9L8M?usp=sharing It is full Open Source, organized in three directories. Execs. ByteCode Compilers and Interpreters. Dynlibs. Dynamic Lib...
by Pancho88
Mon Jan 07, 2019 10:22 pm
Forum: Other programming languages
Topic: WSD scripts a modified pigpio library
Replies: 2
Views: 1225

Re: WSD scripts a modified pigpio library

Hello everyone Here is a conversion of a C program freq_count_1.c to a WSD script freqcnt1.sd c$=chr(10) import xmath if err then print errmsg & c$ : end import xpigpio if err then print errmsg & c$ : end OPT_P_MIN=1 OPT_P_MAX=1000 OPT_P_DEF=20 OPT_R_MIN=1 OPT_R_MAX=300 OPT_R_DEF=10 OPT_S_MIN=1 OPT_...
by Pancho88
Thu Dec 27, 2018 6:31 pm
Forum: Other programming languages
Topic: WSD scripts a modified pigpio library
Replies: 2
Views: 1225

Re: WSD scripts a modified pigpio library

Hello everyone Three more commands have been added to a modified pigpio library. xpigpio.do(CMD_SAF, gpio) 'CMD_SAF=117 gpioSetAlertFunc xpigpio.do(CMD_ISR, gpio, ...) 'CMD_ISR=118 gpioSetISRFunc xpigpio.do(CMD_STF, gpio, xid, xmillis) 'CMD_STF=119 gpioSetTimerFunc Unable to test the first 2 functio...
by Pancho88
Mon Dec 17, 2018 3:27 pm
Forum: Other programming languages
Topic: WSD scripts a modified pigpio library
Replies: 2
Views: 1225

WSD scripts a modified pigpio library

Hello everyone. Refer to Other Programmimg Languages sub-forum, topic Yet Another Programming Language Nov 4, 2018, for more information on WSD. There are two programming efforts. One is to build the Dynamic Libraries. Two is to script those libraries. I modified the pigpio library into a "Lite" sha...
by Pancho88
Mon Nov 05, 2018 4:40 pm
Forum: Other programming languages
Topic: Yet Another Programming Language
Replies: 2
Views: 2706

Re: Yet Another Programming Language

Yes.

It was originally built and tested in Windows, then ported to Android, and now to RPI zerow stretch lite.

It is basically the same for all platforms. Its difference is "dlopen vs Loadlibrary".

Its compiled byte code runs with no change in Windows, Android, and RPI.

Bye
by Pancho88
Sun Nov 04, 2018 8:56 pm
Forum: Other programming languages
Topic: Yet Another Programming Language
Replies: 2
Views: 2706

Yet Another Programming Language

Hello everyone. I have a little experience with electronics/rpi linux, but have much experience programming computers. Browsing the RosettaCode site, i found over 190 programming languages. So i decided to write one more, WSD(Scripting Dynamics). WSD is written in Ansi C. It was built and tested in ...
by Pancho88
Wed Feb 21, 2018 5:10 pm
Forum: Beginners
Topic: sdcard for headless setup
Replies: 2
Views: 374

sdcard for headless setup

Hello everyone. I recently purchased a raspberry pi zeroW, and a 4 Gbytes sdcard loaded with Raspbian(Stretch Lite). By trying a headless setup, I need to copy an empty SSH file, and wpa_supplicant.conf to the sdcard. The problem is my Windows computer sdcard reader is not working. As an alternative...

Go to advanced search