Click here to Skip to main content
15,438,113 members
Home / Discussions / Linux Programming
   

Linux Programming

 
AnswerSOLVED Re: Can "cast looses precision " error be optioned out ? Pin
Vaclav_3-Mar-20 8:00
MemberVaclav_3-Mar-20 8:00 
GeneralRe: SOLVED Re: Can "cast looses precision " error be optioned out ? Pin
k50543-Mar-20 10:36
mvek50543-Mar-20 10:36 
GeneralRe: SOLVED Re: Can "cast looses precision " error be optioned out ? Pin
Vaclav_3-Mar-20 13:47
MemberVaclav_3-Mar-20 13:47 
QuestionBluetooth socket failures Pin
Vaclav_28-Feb-20 5:43
MemberVaclav_28-Feb-20 5:43 
AnswerRe: Bluetooth socket failures Pin
Richard MacCutchan28-Feb-20 6:32
mveRichard MacCutchan28-Feb-20 6:32 
GeneralRe: Bluetooth socket failures Pin
Vaclav_28-Feb-20 7:12
MemberVaclav_28-Feb-20 7:12 
GeneralRe: Bluetooth socket failures Pin
k505429-Feb-20 6:14
mvek505429-Feb-20 6:14 
GeneralRe: Bluetooth socket failures Pin
Vaclav_29-Feb-20 8:27
MemberVaclav_29-Feb-20 8: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

C++
	// 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 21:19
mveRichard MacCutchan29-Feb-20 21:19 
GeneralRe: Bluetooth socket failures Pin
Vaclav_1-Mar-20 4:02
MemberVaclav_1-Mar-20 4:02 
GeneralRe: Bluetooth socket failures Pin
Vaclav_28-Feb-20 8:32
MemberVaclav_28-Feb-20 8:32 
QuestionRunning console apps on windows 7 Pin
Calin Cali23-Feb-20 20:07
MemberCalin Cali23-Feb-20 20:07 
AnswerRe: Running console apps on windows 7 Pin
Victor Nijegorodov23-Feb-20 20:45
MemberVictor Nijegorodov23-Feb-20 20:45 
GeneralRe: Running console apps on windows 7 Pin
Calin Cali23-Feb-20 21:22
MemberCalin Cali23-Feb-20 21:22 
AnswerRe: Running console apps on windows 7 Pin
Richard MacCutchan23-Feb-20 20:59
mveRichard MacCutchan23-Feb-20 20:59 
GeneralRe: Running console apps on windows 7 Pin
Calin Cali23-Feb-20 21:21
MemberCalin Cali23-Feb-20 21:21 
GeneralRe: Running console apps on windows 7 Pin
jsc4229-Feb-20 11:16
professionaljsc4229-Feb-20 11:16 
Questiongetting started with ASM, what compilers do you use? Pin
Calin Cali21-Feb-20 1:47
MemberCalin Cali21-Feb-20 1:47 
AnswerRe: getting started with ASM, what compilers do you use? Pin
Richard MacCutchan21-Feb-20 1:52
mveRichard MacCutchan21-Feb-20 1:52 
GeneralRe: getting started with ASM, what compilers do you use? Pin
Calin Cali21-Feb-20 2:40
MemberCalin Cali21-Feb-20 2:40 
GeneralRe: getting started with ASM, what compilers do you use? Pin
Richard MacCutchan21-Feb-20 3:54
mveRichard MacCutchan21-Feb-20 3:54 
GeneralRe: getting started with ASM, what compilers do you use? Pin
Calin Cali21-Feb-20 6:39
MemberCalin Cali21-Feb-20 6:39 
GeneralRe: getting started with ASM, what compilers do you use? Pin
Richard MacCutchan21-Feb-20 6:50
mveRichard MacCutchan21-Feb-20 6:50 
GeneralRe: getting started with ASM, what compilers do you use? Pin
Calin Cali21-Feb-20 7:04
MemberCalin Cali21-Feb-20 7:04 
QuestionCross compilation mystery Pin
fd97504-Feb-20 4:53
professionalfd97504-Feb-20 4: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.