Click here to Skip to main content
14,772,542 members
Home » Discussions » Linux Programming
   

Linux Programming

 
AnswerSOLVED Re: Can "cast looses precision " error be optioned out ? Pin
Vaclav_3-Mar-20 9:00
MemberVaclav_3-Mar-20 9:00 
GeneralRe: SOLVED Re: Can "cast looses precision " error be optioned out ? Pin
k50543-Mar-20 11:36
mvek50543-Mar-20 11:36 
GeneralRe: SOLVED Re: Can "cast looses precision " error be optioned out ? Pin
Vaclav_3-Mar-20 14:47
MemberVaclav_3-Mar-20 14:47 
QuestionBluetooth socket failures Pin
Vaclav_28-Feb-20 6:43
MemberVaclav_28-Feb-20 6:43 
AnswerRe: Bluetooth socket failures Pin
Richard MacCutchan28-Feb-20 7:32
mveRichard MacCutchan28-Feb-20 7:32 
GeneralRe: Bluetooth socket failures Pin
Vaclav_28-Feb-20 8:12
MemberVaclav_28-Feb-20 8:12 
GeneralRe: Bluetooth socket failures Pin
k505429-Feb-20 7:14
mvek505429-Feb-20 7:14 
GeneralRe: Bluetooth socket failures Pin
Vaclav_29-Feb-20 9:27
MemberVaclav_29-Feb-20 9:27 
I have started doing both checks - return values and errno.
If I understand perror it does something special when errno is zero.
Perhaps I will try to keep track of errno.

There are two "weird" behaviour I am unable to grasp.

I am definitely getting different responses when running SAME code on X86 and ARM7.
I am working on that to make sure.

Even if errno is NOT changed between calls, getting "Invalid parameters" is puzzling when the parameters are SAME in both calls.





Here is a proof you are on the right track !

Code

	// allocate socket
	socket_fd = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
#ifdef TRACE
	cout << "Socket errno " << dec << errno << "  @line " << __LINE__ << endl;
	perror("STATUS allocate socket ");

this call sets the errno to 22 -  AFTER perror is executed with errno being set to 0 success!  
	
cout << "socket_fd  " << dec << socket_fd << endl;

this call 
	cout << "Socket errno " << dec << errno << "  @line " << __LINE__ << endl;
    //exit(-1);
#endif


	// reallocate socket
here the errno is still set to 22 ! 

	socket_fd = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
#ifdef TRACE
	cout << "Socket errno " << dec << errno << "  @line " << __LINE__ << endl;
	perror("STATUS allocate socket ");
	cout << "socket_fd  " << dec << socket_fd << endl;
	cout << "Socket errno " << dec << errno << "  @line " << __LINE__ << endl;
    exit(-1);
#endif



Output


SERVER_X86_228 
RPI_ARM  
date version Feb 29 2020
test time 13:37:53
STATUS allocate socket : Success
 BREAK @line 47
Socket errno 0  @line 61
socket_fd  3
Socket errno 22  @line 64
Socket errno 22  @line 72
socket_fd  4
Socket errno 22  @line 75
STATUS allocate socket : Invalid argument


modified 29-Feb-20 14:47pm.

GeneralRe: Bluetooth socket failures Pin
Richard MacCutchan29-Feb-20 22:19
mveRichard MacCutchan29-Feb-20 22:19 
GeneralRe: Bluetooth socket failures Pin
Vaclav_1-Mar-20 5:02
MemberVaclav_1-Mar-20 5:02 
GeneralRe: Bluetooth socket failures Pin
Vaclav_28-Feb-20 9:32
MemberVaclav_28-Feb-20 9:32 
QuestionRunning console apps on windows 7 Pin
CalinNegru(fearless_)23-Feb-20 21:07
MemberCalinNegru(fearless_)23-Feb-20 21:07 
AnswerRe: Running console apps on windows 7 Pin
Victor Nijegorodov23-Feb-20 21:45
MemberVictor Nijegorodov23-Feb-20 21:45 
GeneralRe: Running console apps on windows 7 Pin
CalinNegru(fearless_)23-Feb-20 22:22
MemberCalinNegru(fearless_)23-Feb-20 22:22 
AnswerRe: Running console apps on windows 7 Pin
Richard MacCutchan23-Feb-20 21:59
mveRichard MacCutchan23-Feb-20 21:59 
GeneralRe: Running console apps on windows 7 Pin
CalinNegru(fearless_)23-Feb-20 22:21
MemberCalinNegru(fearless_)23-Feb-20 22:21 
GeneralRe: Running console apps on windows 7 Pin
jsc4229-Feb-20 12:16
professionaljsc4229-Feb-20 12:16 
Questiongetting started with ASM, what compilers do you use? Pin
CalinNegru(fearless_)21-Feb-20 2:47
MemberCalinNegru(fearless_)21-Feb-20 2:47 
AnswerRe: getting started with ASM, what compilers do you use? Pin
Richard MacCutchan21-Feb-20 2:52
mveRichard MacCutchan21-Feb-20 2:52 
GeneralRe: getting started with ASM, what compilers do you use? Pin
CalinNegru(fearless_)21-Feb-20 3:40
MemberCalinNegru(fearless_)21-Feb-20 3:40 
GeneralRe: getting started with ASM, what compilers do you use? Pin
Richard MacCutchan21-Feb-20 4:54
mveRichard MacCutchan21-Feb-20 4:54 
GeneralRe: getting started with ASM, what compilers do you use? Pin
CalinNegru(fearless_)21-Feb-20 7:39
MemberCalinNegru(fearless_)21-Feb-20 7:39 
GeneralRe: getting started with ASM, what compilers do you use? Pin
Richard MacCutchan21-Feb-20 7:50
mveRichard MacCutchan21-Feb-20 7:50 
GeneralRe: getting started with ASM, what compilers do you use? Pin
CalinNegru(fearless_)21-Feb-20 8:04
MemberCalinNegru(fearless_)21-Feb-20 8:04 
QuestionCross compilation mystery Pin
fd97504-Feb-20 5:53
professionalfd97504-Feb-20 5:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.